mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-05-27 12:52:27 +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:
committed by
Cuong Manh Le
parent
d81042089b
commit
dd930a30a1
@@ -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