cleanup: remove unused service command functions from commands.go

Remove all unused service command functions (initStartCmd, initStopCmd,
initRestartCmd, initReloadCmd, initStatusCmd, initUninstallCmd,
initInterfacesCmd, initClientsCmd, initUpgradeCmd, initServicesCmd)
from commands.go since they have been replaced by modular implementations
in dedicated files. Keep only essential functions: CommandRunner interface,
ServiceManager struct, NewServiceManager function, Status method,
initRunCmd function, and filterEmptyStrings function.

Update cli.go to use InitClientsCmd() and InitUpgradeCmd() instead of
the old init functions. Clean up unused imports and simplify
filterEmptyStrings implementation.

This reduces commands.go from 1202 lines to 103 lines (91% reduction)
and eliminates code duplication while improving maintainability.
This commit is contained in:
Cuong Manh Le authored and Cuong Manh Le committed 2026-04-30 19:19:18 +07:00
1 parent 35cc8adecb
commit b510fe1af5
2 files changed
+9 -1108

No files matched your search

+2 -2
View File
@@ -129,8 +129,8 @@ func initCLI() {
initRunCmd()
InitServiceCmd()
initClientsCmd()
initUpgradeCmd()
InitClientsCmd()
InitUpgradeCmd()
InitLogCmd()
}