Skip to content

Commit 1595639

Browse files
committed
replacing available commands with basic and advanced commands
Signed-off-by: Ayush <[email protected]>
1 parent a4cb407 commit 1595639

18 files changed

+32
-10
lines changed

cmd/limactl/copy.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ func newCopyCommand() *cobra.Command {
3030
Long: copyHelp,
3131
Args: WrapArgsError(cobra.MinimumNArgs(2)),
3232
RunE: copyAction,
33+
GroupID: advancedCommand,
3334
}
3435

3536
copyCommand.Flags().BoolP("recursive", "r", false, "copy directories recursively")

cmd/limactl/delete.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ func newDeleteCommand() *cobra.Command {
2121
Args: WrapArgsError(cobra.MinimumNArgs(1)),
2222
RunE: deleteAction,
2323
ValidArgsFunction: deleteBashComplete,
24+
GroupID: basicCommand,
2425
}
2526
deleteCommand.Flags().BoolP("force", "f", false, "forcibly kill the processes")
2627
return deleteCommand

cmd/limactl/disk.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ func newDiskCommand() *cobra.Command {
3232
$ limactl disk resize DISK --size SIZE`,
3333
SilenceUsage: true,
3434
SilenceErrors: true,
35+
GroupID: advancedCommand,
3536
}
3637
diskCommand.AddCommand(
3738
newDiskCreateCommand(),

cmd/limactl/edit.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ func newEditCommand() *cobra.Command {
2727
Args: WrapArgsError(cobra.MaximumNArgs(1)),
2828
RunE: editAction,
2929
ValidArgsFunction: editBashComplete,
30+
GroupID: basicCommand,
3031
}
3132
editflags.RegisterEdit(editCommand)
3233
return editCommand

cmd/limactl/factory-reset.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ func newFactoryResetCommand() *cobra.Command {
1919
Args: WrapArgsError(cobra.MaximumNArgs(1)),
2020
RunE: factoryResetAction,
2121
ValidArgsFunction: factoryResetBashComplete,
22+
GroupID: advancedCommand,
2223
}
2324
return resetCommand
2425
}

cmd/limactl/info.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@ import (
1010

1111
func newInfoCommand() *cobra.Command {
1212
infoCommand := &cobra.Command{
13-
Use: "info",
14-
Short: "Show diagnostic information",
15-
Args: WrapArgsError(cobra.NoArgs),
16-
RunE: infoAction,
13+
Use: "info",
14+
Short: "Show diagnostic information",
15+
Args: WrapArgsError(cobra.NoArgs),
16+
RunE: infoAction,
17+
GroupID: advancedCommand,
1718
}
1819
return infoCommand
1920
}

cmd/limactl/list.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ func newListCommand() *cobra.Command {
5252
Args: WrapArgsError(cobra.ArbitraryArgs),
5353
RunE: listAction,
5454
ValidArgsFunction: listBashComplete,
55+
GroupID: basicCommand,
5556
}
5657

5758
listCommand.Flags().StringP("format", "f", "table", "output format, one of: json, yaml, table, go-template")

cmd/limactl/main.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ import (
1818

1919
const (
2020
DefaultInstanceName = "default"
21+
basicCommand = "basic"
22+
advancedCommand = "advanced"
2123
)
2224

2325
func main() {
@@ -95,6 +97,8 @@ func newApp() *cobra.Command {
9597
}
9698
return nil
9799
}
100+
rootCmd.AddGroup(&cobra.Group{ID: "basic", Title: "Basic Commands:"})
101+
rootCmd.AddGroup(&cobra.Group{ID: "advanced", Title: "Advanced Commands:"})
98102
rootCmd.AddCommand(
99103
newCreateCommand(),
100104
newStartCommand(),

cmd/limactl/protect.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ The instance is not being protected against removal via '/bin/rm', Finder, etc.`
1818
Args: WrapArgsError(cobra.MinimumNArgs(1)),
1919
RunE: protectAction,
2020
ValidArgsFunction: protectBashComplete,
21+
GroupID: advancedCommand,
2122
}
2223
return protectCommand
2324
}

cmd/limactl/prune.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ func newPruneCommand() *cobra.Command {
1515
Args: WrapArgsError(cobra.NoArgs),
1616
RunE: pruneAction,
1717
ValidArgsFunction: cobra.NoFileCompletions,
18+
GroupID: advancedCommand,
1819
}
1920
return pruneCommand
2021
}

0 commit comments

Comments
 (0)