feat(version): adds --short flag to only show release information
This commit is contained in:
parent
9130c09e56
commit
59cb09a8e7
2 changed files with 18 additions and 1 deletions
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue