From 37523fdc45cd36aa624464fe30566f182b72a639 Mon Sep 17 00:00:00 2001 From: Cuong Manh Le Date: Tue, 29 Jul 2025 17:02:24 +0700 Subject: [PATCH] fix: register uninstall command before interfaces command To keep the same order with v1.0 service sub-commands list. --- cmd/cli/commands_service.go | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/cmd/cli/commands_service.go b/cmd/cli/commands_service.go index ad078cc..d9cb5f0 100644 --- a/cmd/cli/commands_service.go +++ b/cmd/cli/commands_service.go @@ -55,20 +55,6 @@ func InitServiceCmd() *cobra.Command { 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) rootCmd.AddCommand(startCmdAlias) @@ -122,6 +108,20 @@ NOTE: Uninstalling will set DNS to values provided by DHCP.`, 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 interfacesCmd := InitInterfacesCmd()