feat(version): adds --short flag to only show release information

This commit is contained in:
Lewis Wynne 2026-02-11 18:16:37 +00:00
parent 9130c09e56
commit 59cb09a8e7
2 changed files with 18 additions and 1 deletions

View file

@ -36,7 +36,8 @@ var versionCmd = &cobra.Command{
Use: "version",
Short: "Display pda! version",
Run: func(cmd *cobra.Command, args []string) {
if config.DisplayAsciiArt {
short, _ := cmd.Flags().GetBool("short")
if !short && config.DisplayAsciiArt {
fmt.Print(asciiArt + "\n ")
}
fmt.Printf("%s\n", version)
@ -44,5 +45,6 @@ var versionCmd = &cobra.Command{
}
func init() {
versionCmd.Flags().Bool("short", false, "Print only the version string")
rootCmd.AddCommand(versionCmd)
}