adapted version generation to cfg module, added and fixed unit tests

This commit is contained in:
2022-10-19 19:32:41 +02:00
parent 90872e0c60
commit 9dd2a49d9b
7 changed files with 135 additions and 21 deletions

View File

@@ -61,6 +61,7 @@ func Execute() {
RunE: func(cmd *cobra.Command, args []string) error {
if ShowVersion {
fmt.Println(cfg.Getversion())
return nil
}
if ShowManual {
@@ -112,7 +113,7 @@ func Execute() {
_ = rootCmd.Flags().MarkHidden("yaml")
// same thing but more common, takes precedence over above group
rootCmd.PersistentFlags().StringVarP(&Outputmode, "output", "o", "ascii", "Output mode - one of: orgtbl, markdown, extended, shell, ascii(default)")
rootCmd.PersistentFlags().StringVarP(&Outputmode, "output", "o", "", "Output mode - one of: orgtbl, markdown, extended, shell, ascii(default)")
err := rootCmd.Execute()
if err != nil {