added yamltool sort

This commit is contained in:
2026-03-08 15:39:52 +01:00
parent 2bb8d68edd
commit ea6568a0d3
7 changed files with 259 additions and 20 deletions
+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,