added CSV output mode, enhanced parser tests

This commit is contained in:
2022-10-23 16:57:30 +02:00
parent b5c802403b
commit 138ae51936
11 changed files with 148 additions and 104 deletions

View File

@@ -73,6 +73,7 @@ func Execute() {
conf.CheckEnv()
conf.PrepareModeFlags(modeflag)
conf.PrepareSortFlags(sortmode)
conf.ApplyDefaults()
// actual execution starts here
return lib.ProcessFiles(conf, args)
@@ -105,7 +106,8 @@ func Execute() {
rootCmd.PersistentFlags().BoolVarP(&modeflag.O, "orgtbl", "O", false, "Enable org-mode table output")
rootCmd.PersistentFlags().BoolVarP(&modeflag.S, "shell", "S", false, "Enable shell mode output")
rootCmd.PersistentFlags().BoolVarP(&modeflag.Y, "yaml", "Y", false, "Enable yaml output")
rootCmd.MarkFlagsMutuallyExclusive("extended", "markdown", "orgtbl", "shell", "yaml")
rootCmd.PersistentFlags().BoolVarP(&modeflag.C, "csv", "C", false, "Enable CSV output")
rootCmd.MarkFlagsMutuallyExclusive("extended", "markdown", "orgtbl", "shell", "yaml", "csv")
rootCmd.SetUsageTemplate(strings.TrimSpace(usage) + "\n")