mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-02-03 22:18:39 +00:00
refactor: fix createStartCommands to follow single responsibility principle
Remove rootCmd.AddCommand call from createStartCommands function. The function should only create and return commands, not add them to the root command hierarchy. This responsibility belongs to the caller (InitServiceCmd). This change improves: - Separation of concerns: function has single responsibility - Testability: no hidden side effects - Flexibility: caller controls command registration - Clean architecture: follows principle of no hidden dependencies
This commit is contained in:
committed by
Cuong Manh Le
parent
a22f0579d5
commit
ca505f1140
@@ -373,7 +373,6 @@ NOTE: running "ctrld start" without any arguments will start already installed c
|
||||
}
|
||||
startCmdAlias.Flags().StringVarP(&ifaceStartStop, "iface", "", "auto", `Update DNS setting for iface, "auto" means the default interface gateway`)
|
||||
startCmdAlias.Flags().AddFlagSet(startCmd.Flags())
|
||||
rootCmd.AddCommand(startCmdAlias)
|
||||
|
||||
return startCmd, startCmdAlias
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user