add --json flag to command

This commit is contained in:
Alekzus 2022-03-14 17:22:28 +01:00
parent f4dedc8726
commit 7d0c6e3199
3 changed files with 3 additions and 0 deletions

View file

@ -18,6 +18,7 @@ var createCmd = &cobra.Command{
func init() {
rootCmd.AddCommand(createCmd)
createCmd.PersistentFlags().BoolP("json", "j", false, "Outputs JSON")
createCmd.AddCommand(resource.ResourceCreateCmd)
createCmd.AddCommand(folder.FolderCreateCmd)
createCmd.AddCommand(group.GroupCreateCmd)

View file

@ -18,6 +18,7 @@ var getCmd = &cobra.Command{
func init() {
rootCmd.AddCommand(getCmd)
getCmd.PersistentFlags().BoolP("json", "j", false, "Outputs JSON")
getCmd.AddCommand(resource.ResourceGetCmd)
getCmd.AddCommand(folder.FolderGetCmd)
getCmd.AddCommand(group.GroupGetCmd)

View file

@ -18,6 +18,7 @@ var listCmd = &cobra.Command{
func init() {
rootCmd.AddCommand(listCmd)
listCmd.PersistentFlags().BoolP("json", "j", false, "Outputs JSON")
listCmd.AddCommand(resource.ResourceListCmd)
listCmd.AddCommand(folder.FolderListCmd)
listCmd.AddCommand(group.GroupListCmd)