added yamltool sort

This commit is contained in:
Erik Brakkee committed 2026-03-08 15:39:52 +01:00
1 parent 6162670570
commit ebf888d91d
7 files changed
+259 -20

No files matched your search

+10
View File
@@ -67,6 +67,16 @@ Shows the additions and modifications in <file2> compared to <file1>`,
}
cmd.AddCommand(parse)
sort := &cobra.Command{
Use: "sort [file1] ... [fileN]",
Short: "Sort the yaml output by sorting based on map key ",
Long: `Sort yaml files, this makes it easier to also use regular diff`,
RunE: func(cmd *cobra.Command, args []string) error {
return sortYaml(cmd, args)
},
}
cmd.AddCommand(sort)
diff.PersistentFlags().IntVarP(&VERBOSITY, "array-output-level",
"v", 3, `Array output level: ,
0: no output, only exit status,