diff options
author | Martin Polden <mpolden@mpolden.no> | 2021-08-27 08:44:08 +0200 |
---|---|---|
committer | Martin Polden <mpolden@mpolden.no> | 2021-08-27 09:15:27 +0200 |
commit | 4e5b62fedee054dc2b06d2fd82e722009a72f3c0 (patch) | |
tree | ecd79cff8bcb8d7a3eb25ede9f5ee0d0f89b294a /client | |
parent | ef4b8d2e8a59f0b87fa9640d1fd1e370a181dd19 (diff) |
Only declare target option for relevant commands
Diffstat (limited to 'client')
-rw-r--r-- | client/go/cmd/activate.go | 1 | ||||
-rw-r--r-- | client/go/cmd/deploy.go | 1 | ||||
-rw-r--r-- | client/go/cmd/document.go | 1 | ||||
-rw-r--r-- | client/go/cmd/prepare.go | 1 | ||||
-rw-r--r-- | client/go/cmd/query.go | 1 | ||||
-rw-r--r-- | client/go/cmd/root.go | 5 | ||||
-rw-r--r-- | client/go/cmd/status.go | 1 |
7 files changed, 10 insertions, 1 deletions
diff --git a/client/go/cmd/activate.go b/client/go/cmd/activate.go index b7b3fa22a05..70aed151a6d 100644 --- a/client/go/cmd/activate.go +++ b/client/go/cmd/activate.go @@ -10,6 +10,7 @@ import ( func init() { rootCmd.AddCommand(activateCmd) + addTargetFlag(activateCmd) } // TODO: Implement and test diff --git a/client/go/cmd/deploy.go b/client/go/cmd/deploy.go index f3d9eb15596..ed7f7264fcc 100644 --- a/client/go/cmd/deploy.go +++ b/client/go/cmd/deploy.go @@ -13,6 +13,7 @@ import ( func init() { rootCmd.AddCommand(deployCmd) + addTargetFlag(deployCmd) } var deployCmd = &cobra.Command{ diff --git a/client/go/cmd/document.go b/client/go/cmd/document.go index 41f8c8f3320..cf820d624a4 100644 --- a/client/go/cmd/document.go +++ b/client/go/cmd/document.go @@ -23,6 +23,7 @@ func init() { rootCmd.AddCommand(documentCmd) documentCmd.AddCommand(documentPostCmd) documentCmd.AddCommand(documentGetCmd) + addTargetFlag(documentCmd) } var documentCmd = &cobra.Command{ diff --git a/client/go/cmd/prepare.go b/client/go/cmd/prepare.go index 1790629ca2c..5f31d0b8e23 100644 --- a/client/go/cmd/prepare.go +++ b/client/go/cmd/prepare.go @@ -10,6 +10,7 @@ import ( func init() { rootCmd.AddCommand(prepareCmd) + addTargetFlag(prepareCmd) } // TODO: Implement and test diff --git a/client/go/cmd/query.go b/client/go/cmd/query.go index dea7e70b19e..3e6a255acc9 100644 --- a/client/go/cmd/query.go +++ b/client/go/cmd/query.go @@ -18,6 +18,7 @@ import ( func init() { rootCmd.AddCommand(queryCmd) + addTargetFlag(queryCmd) } var queryCmd = &cobra.Command{ diff --git a/client/go/cmd/root.go b/client/go/cmd/root.go index bb74e9b5539..8c7ab2da12b 100644 --- a/client/go/cmd/root.go +++ b/client/go/cmd/root.go @@ -39,7 +39,10 @@ func configureLogger() { func init() { configureLogger() cobra.OnInitialize(readConfig) - rootCmd.PersistentFlags().StringVarP(&targetArgument, "target", "t", "local", "The name or URL of the recipient of this command") +} + +func addTargetFlag(command *cobra.Command) { + command.PersistentFlags().StringVarP(&targetArgument, "target", "t", "local", "The name or URL of the recipient of this command") } // Execute executes the root command. diff --git a/client/go/cmd/status.go b/client/go/cmd/status.go index fa70aec302f..75bc9748cdc 100644 --- a/client/go/cmd/status.go +++ b/client/go/cmd/status.go @@ -16,6 +16,7 @@ func init() { statusCmd.AddCommand(statusQueryCmd) statusCmd.AddCommand(statusDocumentCmd) statusCmd.AddCommand(statusDeployCmd) + addTargetFlag(statusCmd) } var statusCmd = &cobra.Command{ |