mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-07-29 01:18:48 +02:00
fix: register uninstall command before interfaces command
To keep the same order with v1.0 service sub-commands list.
This commit is contained in:
+14
-14
@@ -55,20 +55,6 @@ func InitServiceCmd() *cobra.Command {
|
|||||||
panic(fmt.Sprintf("failed to create service command: %v", err))
|
panic(fmt.Sprintf("failed to create service command: %v", err))
|
||||||
}
|
}
|
||||||
|
|
||||||
// Uninstall command
|
|
||||||
uninstallCmd := &cobra.Command{
|
|
||||||
Use: "uninstall",
|
|
||||||
Short: "Stop and uninstall the ctrld service",
|
|
||||||
Long: `Stop and uninstall the ctrld service.
|
|
||||||
|
|
||||||
NOTE: Uninstalling will set DNS to values provided by DHCP.`,
|
|
||||||
Args: cobra.NoArgs,
|
|
||||||
PreRun: func(cmd *cobra.Command, args []string) {
|
|
||||||
checkHasElevatedPrivilege()
|
|
||||||
},
|
|
||||||
RunE: sc.Uninstall,
|
|
||||||
}
|
|
||||||
|
|
||||||
startCmd, startCmdAlias := createStartCommands(sc)
|
startCmd, startCmdAlias := createStartCommands(sc)
|
||||||
rootCmd.AddCommand(startCmdAlias)
|
rootCmd.AddCommand(startCmdAlias)
|
||||||
|
|
||||||
@@ -122,6 +108,20 @@ NOTE: Uninstalling will set DNS to values provided by DHCP.`,
|
|||||||
RunE: sc.Reload,
|
RunE: sc.Reload,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Uninstall command
|
||||||
|
uninstallCmd := &cobra.Command{
|
||||||
|
Use: "uninstall",
|
||||||
|
Short: "Stop and uninstall the ctrld service",
|
||||||
|
Long: `Stop and uninstall the ctrld service.
|
||||||
|
|
||||||
|
NOTE: Uninstalling will set DNS to values provided by DHCP.`,
|
||||||
|
Args: cobra.NoArgs,
|
||||||
|
PreRun: func(cmd *cobra.Command, args []string) {
|
||||||
|
checkHasElevatedPrivilege()
|
||||||
|
},
|
||||||
|
RunE: sc.Uninstall,
|
||||||
|
}
|
||||||
|
|
||||||
// Interfaces command - use the existing InitInterfacesCmd function
|
// Interfaces command - use the existing InitInterfacesCmd function
|
||||||
interfacesCmd := InitInterfacesCmd()
|
interfacesCmd := InitInterfacesCmd()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user