mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-08-23 01:27:13 +02: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:
@@ -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