From 2ef837f02fe47e77a915325f263c626937aa94f5 Mon Sep 17 00:00:00 2001 From: James Rasell Date: Fri, 25 Jul 2025 08:05:10 +0200 Subject: [PATCH] cli: Ensure all no argument console messages are the same. (#26331) Use a constant to ensure consistency across the CLI when displaying a console message indicating the command was passed arguments when it takes none. --- command/acl_auth_method_create.go | 2 +- command/acl_auth_method_create_test.go | 2 +- command/acl_auth_method_list.go | 2 +- command/acl_binding_rule_create.go | 2 +- command/acl_binding_rule_create_test.go | 2 +- command/acl_binding_rule_list.go | 2 +- command/acl_policy_list.go | 2 +- command/acl_policy_self.go | 2 +- command/acl_role_create.go | 2 +- command/acl_role_create_test.go | 2 +- command/acl_role_list.go | 2 +- command/acl_token_create.go | 2 +- command/acl_token_list.go | 2 +- command/acl_token_self.go | 2 +- command/agent_info.go | 2 +- command/agent_monitor.go | 2 +- command/check.go | 2 +- command/deployment_list.go | 2 +- command/eval_list.go | 2 +- command/helpers.go | 4 ++++ command/login.go | 2 +- command/login_test.go | 2 +- command/metrics.go | 2 +- command/namespace_list.go | 2 +- command/node_pool_list.go | 2 +- command/node_pool_list_test.go | 2 +- command/operator_debug.go | 2 +- command/operator_debug_test.go | 2 +- command/operator_gossip_keyring_list.go | 2 +- command/operator_root_keyring_list.go | 2 +- command/operator_root_keyring_rotate.go | 2 +- command/operator_scheduler_set_config.go | 2 +- command/operator_utilization.go | 2 +- command/quota_list.go | 2 +- command/recommendation_list.go | 2 +- command/scaling_policy_list.go | 2 +- command/sentinel_list.go | 2 +- command/server_members.go | 2 +- command/service_list.go | 2 +- command/service_list_test.go | 2 +- command/setup_consul.go | 2 +- command/setup_vault.go | 2 +- command/system_gc.go | 2 +- command/system_reconcile_summaries.go | 2 +- command/volume_snapshot_list.go | 2 +- 45 files changed, 48 insertions(+), 44 deletions(-) diff --git a/command/acl_auth_method_create.go b/command/acl_auth_method_create.go index 72a366b92..c44ecebbe 100644 --- a/command/acl_auth_method_create.go +++ b/command/acl_auth_method_create.go @@ -131,7 +131,7 @@ func (a *ACLAuthMethodCreateCommand) Run(args []string) int { // Check that we got no arguments. if len(flags.Args()) != 0 { - a.Ui.Error("This command takes no arguments") + a.Ui.Error(uiMessageNoArguments) a.Ui.Error(commandErrorText(a)) return 1 } diff --git a/command/acl_auth_method_create_test.go b/command/acl_auth_method_create_test.go index 0b5e69c59..3efc37825 100644 --- a/command/acl_auth_method_create_test.go +++ b/command/acl_auth_method_create_test.go @@ -41,7 +41,7 @@ func TestACLAuthMethodCreateCommand_Run(t *testing.T) { // Test the basic validation on the command. must.Eq(t, 1, cmd.Run([]string{"-address=" + url, "this-command-does-not-take-args"})) - must.StrContains(t, ui.ErrorWriter.String(), "This command takes no arguments") + must.StrContains(t, ui.ErrorWriter.String(), uiMessageNoArguments) ui.OutputWriter.Reset() ui.ErrorWriter.Reset() diff --git a/command/acl_auth_method_list.go b/command/acl_auth_method_list.go index 21e69327e..eeed5194f 100644 --- a/command/acl_auth_method_list.go +++ b/command/acl_auth_method_list.go @@ -77,7 +77,7 @@ func (a *ACLAuthMethodListCommand) Run(args []string) int { // Check that we got no arguments if len(flags.Args()) != 0 { - a.Ui.Error("This command takes no arguments") + a.Ui.Error(uiMessageNoArguments) a.Ui.Error(commandErrorText(a)) return 1 } diff --git a/command/acl_binding_rule_create.go b/command/acl_binding_rule_create.go index 9a730d797..f865a1931 100644 --- a/command/acl_binding_rule_create.go +++ b/command/acl_binding_rule_create.go @@ -117,7 +117,7 @@ func (a *ACLBindingRuleCreateCommand) Run(args []string) int { // Check that we got no arguments. if len(flags.Args()) != 0 { - a.Ui.Error("This command takes no arguments") + a.Ui.Error(uiMessageNoArguments) a.Ui.Error(commandErrorText(a)) return 1 } diff --git a/command/acl_binding_rule_create_test.go b/command/acl_binding_rule_create_test.go index 3a32346e1..f8ab7a0ff 100644 --- a/command/acl_binding_rule_create_test.go +++ b/command/acl_binding_rule_create_test.go @@ -39,7 +39,7 @@ func TestACLBindingRuleCreateCommand_Run(t *testing.T) { // Test the basic validation on the command. must.Eq(t, 1, cmd.Run([]string{"-address=" + url, "this-command-does-not-take-args"})) - must.StrContains(t, ui.ErrorWriter.String(), "This command takes no arguments") + must.StrContains(t, ui.ErrorWriter.String(), uiMessageNoArguments) ui.OutputWriter.Reset() ui.ErrorWriter.Reset() diff --git a/command/acl_binding_rule_list.go b/command/acl_binding_rule_list.go index 6cd70795f..cd8c19bd5 100644 --- a/command/acl_binding_rule_list.go +++ b/command/acl_binding_rule_list.go @@ -78,7 +78,7 @@ func (a *ACLBindingRuleListCommand) Run(args []string) int { // Check that we got no arguments if len(flags.Args()) != 0 { - a.Ui.Error("This command takes no arguments") + a.Ui.Error(uiMessageNoArguments) a.Ui.Error(commandErrorText(a)) return 1 } diff --git a/command/acl_policy_list.go b/command/acl_policy_list.go index 7e8bb6298..1ff2530d0 100644 --- a/command/acl_policy_list.go +++ b/command/acl_policy_list.go @@ -74,7 +74,7 @@ func (c *ACLPolicyListCommand) Run(args []string) int { // Check that we got no arguments args = flags.Args() if l := len(args); l != 0 { - c.Ui.Error("This command takes no arguments") + c.Ui.Error(uiMessageNoArguments) c.Ui.Error(commandErrorText(c)) return 1 } diff --git a/command/acl_policy_self.go b/command/acl_policy_self.go index c574fa244..d39b22a60 100644 --- a/command/acl_policy_self.go +++ b/command/acl_policy_self.go @@ -69,7 +69,7 @@ func (c *ACLPolicySelfCommand) Run(args []string) int { // Check that we have no arguments args = flags.Args() if l := len(args); l != 0 { - c.Ui.Error("This command takes no arguments") + c.Ui.Error(uiMessageNoArguments) c.Ui.Error(commandErrorText(c)) return 1 } diff --git a/command/acl_role_create.go b/command/acl_role_create.go index bd4d11d7b..de33dfae5 100644 --- a/command/acl_role_create.go +++ b/command/acl_role_create.go @@ -98,7 +98,7 @@ func (a *ACLRoleCreateCommand) Run(args []string) int { // Check that we got no arguments. if len(flags.Args()) != 0 { - a.Ui.Error("This command takes no arguments") + a.Ui.Error(uiMessageNoArguments) a.Ui.Error(commandErrorText(a)) return 1 } diff --git a/command/acl_role_create_test.go b/command/acl_role_create_test.go index 69652b621..478004240 100644 --- a/command/acl_role_create_test.go +++ b/command/acl_role_create_test.go @@ -38,7 +38,7 @@ func TestACLRoleCreateCommand_Run(t *testing.T) { // Test the basic validation on the command. must.One(t, cmd.Run([]string{"-address=" + url, "this-command-does-not-take-args"})) - must.StrContains(t, ui.ErrorWriter.String(), "This command takes no arguments") + must.StrContains(t, ui.ErrorWriter.String(), uiMessageNoArguments) ui.OutputWriter.Reset() ui.ErrorWriter.Reset() diff --git a/command/acl_role_list.go b/command/acl_role_list.go index c4a653040..e9a1d1de5 100644 --- a/command/acl_role_list.go +++ b/command/acl_role_list.go @@ -75,7 +75,7 @@ func (a *ACLRoleListCommand) Run(args []string) int { // Check that we got no arguments if len(flags.Args()) != 0 { - a.Ui.Error("This command takes no arguments") + a.Ui.Error(uiMessageNoArguments) a.Ui.Error(commandErrorText(a)) return 1 } diff --git a/command/acl_token_create.go b/command/acl_token_create.go index ecc187161..387f3c791 100644 --- a/command/acl_token_create.go +++ b/command/acl_token_create.go @@ -122,7 +122,7 @@ func (c *ACLTokenCreateCommand) Run(args []string) int { // Check that we got no arguments args = flags.Args() if l := len(args); l != 0 { - c.Ui.Error("This command takes no arguments") + c.Ui.Error(uiMessageNoArguments) c.Ui.Error(commandErrorText(c)) return 1 } diff --git a/command/acl_token_list.go b/command/acl_token_list.go index 9bcb20bf0..aadbc9416 100644 --- a/command/acl_token_list.go +++ b/command/acl_token_list.go @@ -72,7 +72,7 @@ func (c *ACLTokenListCommand) Run(args []string) int { // Check that we got no arguments args = flags.Args() if l := len(args); l != 0 { - c.Ui.Error("This command takes no arguments") + c.Ui.Error(uiMessageNoArguments) c.Ui.Error(commandErrorText(c)) return 1 } diff --git a/command/acl_token_self.go b/command/acl_token_self.go index 261482e8d..3b4db2477 100644 --- a/command/acl_token_self.go +++ b/command/acl_token_self.go @@ -53,7 +53,7 @@ func (c *ACLTokenSelfCommand) Run(args []string) int { // Check that we have no arguments args = flags.Args() if l := len(args); l != 0 { - c.Ui.Error("This command takes no arguments") + c.Ui.Error(uiMessageNoArguments) c.Ui.Error(commandErrorText(c)) return 1 } diff --git a/command/agent_info.go b/command/agent_info.go index b0a8f01e7..e1bd61f38 100644 --- a/command/agent_info.go +++ b/command/agent_info.go @@ -74,7 +74,7 @@ func (c *AgentInfoCommand) Run(args []string) int { // Check that we got no arguments args = flags.Args() if len(args) > 0 { - c.Ui.Error("This command takes no arguments") + c.Ui.Error(uiMessageNoArguments) c.Ui.Error(commandErrorText(c)) return 1 } diff --git a/command/agent_monitor.go b/command/agent_monitor.go index e6b9ffcf8..2b177e237 100644 --- a/command/agent_monitor.go +++ b/command/agent_monitor.go @@ -92,7 +92,7 @@ func (c *MonitorCommand) Run(args []string) int { args = flags.Args() if l := len(args); l != 0 { - c.Ui.Error("This command takes no arguments") + c.Ui.Error(uiMessageNoArguments) c.Ui.Error(commandErrorText(c)) return 1 } diff --git a/command/check.go b/command/check.go index 73bee3e8f..43a8f6a65 100644 --- a/command/check.go +++ b/command/check.go @@ -66,7 +66,7 @@ func (c *AgentCheckCommand) Run(args []string) int { args = flags.Args() if len(args) > 0 { - c.Ui.Error("This command takes no arguments") + c.Ui.Error(uiMessageNoArguments) c.Ui.Error(commandErrorText(c)) return 1 } diff --git a/command/deployment_list.go b/command/deployment_list.go index 485df3c7e..80b9d6ebb 100644 --- a/command/deployment_list.go +++ b/command/deployment_list.go @@ -83,7 +83,7 @@ func (c *DeploymentListCommand) Run(args []string) int { // Check that we got no arguments args = flags.Args() if l := len(args); l != 0 { - c.Ui.Error("This command takes no arguments") + c.Ui.Error(uiMessageNoArguments) c.Ui.Error(commandErrorText(c)) return 1 } diff --git a/command/eval_list.go b/command/eval_list.go index 305b03a1d..95c2bc490 100644 --- a/command/eval_list.go +++ b/command/eval_list.go @@ -121,7 +121,7 @@ func (c *EvalListCommand) Run(args []string) int { // Check that we got no arguments args = flags.Args() if l := len(args); l != 0 { - c.Ui.Error("This command takes no arguments") + c.Ui.Error(uiMessageNoArguments) c.Ui.Error(commandErrorText(c)) return 1 } diff --git a/command/helpers.go b/command/helpers.go index 36bb69fd7..e871d0cff 100644 --- a/command/helpers.go +++ b/command/helpers.go @@ -32,6 +32,10 @@ const ( formatHCL2 = "hcl2" ) +// uiMessageNoArguments is the message to write to the UI when a command is +// passed arguments, but it does not take any. +const uiMessageNoArguments = "This command takes no arguments" + // maxLineLength is the maximum width of any line. const maxLineLength int = 78 diff --git a/command/login.go b/command/login.go index a30eb22f5..39eff0668 100644 --- a/command/login.go +++ b/command/login.go @@ -105,7 +105,7 @@ func (l *LoginCommand) Run(args []string) int { args = flags.Args() if len(args) != 0 { - l.Ui.Error("This command takes no arguments") + l.Ui.Error(uiMessageNoArguments) l.Ui.Error(commandErrorText(l)) return 1 } diff --git a/command/login_test.go b/command/login_test.go index 47815a8ba..3a306349d 100644 --- a/command/login_test.go +++ b/command/login_test.go @@ -36,7 +36,7 @@ func TestLoginCommand_Run(t *testing.T) { // Test the basic validation on the command. must.Eq(t, 1, cmd.Run([]string{"-address=" + agentURL, "this-command-does-not-take-args"})) - must.StrContains(t, ui.ErrorWriter.String(), "This command takes no arguments") + must.StrContains(t, ui.ErrorWriter.String(), uiMessageNoArguments) ui.OutputWriter.Reset() ui.ErrorWriter.Reset() diff --git a/command/metrics.go b/command/metrics.go index c0c6a1c43..e9bbea3ce 100644 --- a/command/metrics.go +++ b/command/metrics.go @@ -78,7 +78,7 @@ func (c *OperatorMetricsCommand) Run(args []string) int { args = flags.Args() if l := len(args); l != 0 { - c.Ui.Error("This command takes no arguments") + c.Ui.Error(uiMessageNoArguments) c.Ui.Error(commandErrorText(c)) return 1 } diff --git a/command/namespace_list.go b/command/namespace_list.go index c07a9d1da..e3796d91c 100644 --- a/command/namespace_list.go +++ b/command/namespace_list.go @@ -75,7 +75,7 @@ func (c *NamespaceListCommand) Run(args []string) int { // Check that we got no arguments args = flags.Args() if l := len(args); l != 0 { - c.Ui.Error("This command takes no arguments") + c.Ui.Error(uiMessageNoArguments) c.Ui.Error(commandErrorText(c)) return 1 } diff --git a/command/node_pool_list.go b/command/node_pool_list.go index d04d7ea72..08d91bb4d 100644 --- a/command/node_pool_list.go +++ b/command/node_pool_list.go @@ -93,7 +93,7 @@ func (c *NodePoolListCommand) Run(args []string) int { // Check that we don't have any arguments. if len(flags.Args()) != 0 { - c.Ui.Error("This command takes no arguments") + c.Ui.Error(uiMessageNoArguments) c.Ui.Error(commandErrorText(c)) return 1 } diff --git a/command/node_pool_list_test.go b/command/node_pool_list_test.go index cdea0f45b..0fe6ec9b2 100644 --- a/command/node_pool_list_test.go +++ b/command/node_pool_list_test.go @@ -122,7 +122,7 @@ prod-1 `, { name: "fail because of arg", args: []string{"invalid"}, - expectedErr: "This command takes no arguments", + expectedErr: uiMessageNoArguments, expectedCode: 1, }, { diff --git a/command/operator_debug.go b/command/operator_debug.go index 06f96c4ed..0bdb9ac9c 100644 --- a/command/operator_debug.go +++ b/command/operator_debug.go @@ -462,7 +462,7 @@ func (c *OperatorDebugCommand) Run(args []string) int { // Verify there are no extra arguments args = flags.Args() if l := len(args); l != 0 { - c.Ui.Error("This command takes no arguments") + c.Ui.Error(uiMessageNoArguments) c.Ui.Error(commandErrorText(c)) return 1 } diff --git a/command/operator_debug_test.go b/command/operator_debug_test.go index 05b0131f8..fa7640dfa 100644 --- a/command/operator_debug_test.go +++ b/command/operator_debug_test.go @@ -326,7 +326,7 @@ func TestDebug_Failures(t *testing.T) { name: "fails incorrect args", args: []string{"some", "bad", "args"}, expectedCode: 1, - expectedError: "This command takes no arguments", + expectedError: uiMessageNoArguments, }, { name: "Fails illegal node ids", diff --git a/command/operator_gossip_keyring_list.go b/command/operator_gossip_keyring_list.go index 8ea32a3be..a55d23d4c 100644 --- a/command/operator_gossip_keyring_list.go +++ b/command/operator_gossip_keyring_list.go @@ -68,7 +68,7 @@ func (c *OperatorGossipKeyringListCommand) Run(args []string) int { args = flags.Args() if len(args) != 0 { - c.Ui.Error("This command requires no arguments") + c.Ui.Error(uiMessageNoArguments) c.Ui.Error(commandErrorText(c)) return 1 } diff --git a/command/operator_root_keyring_list.go b/command/operator_root_keyring_list.go index 29b740522..b630cbdc3 100644 --- a/command/operator_root_keyring_list.go +++ b/command/operator_root_keyring_list.go @@ -70,7 +70,7 @@ func (c *OperatorRootKeyringListCommand) Run(args []string) int { args = flags.Args() if len(args) != 0 { - c.Ui.Error("This command requires no arguments.") + c.Ui.Error(uiMessageNoArguments) c.Ui.Error(commandErrorText(c)) return 1 } diff --git a/command/operator_root_keyring_rotate.go b/command/operator_root_keyring_rotate.go index 70271666c..00f0c772a 100644 --- a/command/operator_root_keyring_rotate.go +++ b/command/operator_root_keyring_rotate.go @@ -94,7 +94,7 @@ func (c *OperatorRootKeyringRotateCommand) Run(args []string) int { args = flags.Args() if len(args) != 0 { - c.Ui.Error("This command requires no arguments.") + c.Ui.Error(uiMessageNoArguments) c.Ui.Error(commandErrorText(c)) return 1 } diff --git a/command/operator_scheduler_set_config.go b/command/operator_scheduler_set_config.go index 718b94840..0ad7cb685 100644 --- a/command/operator_scheduler_set_config.go +++ b/command/operator_scheduler_set_config.go @@ -87,7 +87,7 @@ func (o *OperatorSchedulerSetConfig) Run(args []string) int { // Check that we got no arguments. args = flags.Args() if l := len(args); l != 0 { - o.Ui.Error("This command takes no arguments") + o.Ui.Error(uiMessageNoArguments) o.Ui.Error(commandErrorText(o)) return 1 } diff --git a/command/operator_utilization.go b/command/operator_utilization.go index f5392373e..a58676aca 100644 --- a/command/operator_utilization.go +++ b/command/operator_utilization.go @@ -77,7 +77,7 @@ func (c *OperatorUtilizationCommand) Run(args []string) int { args = flags.Args() if len(args) != 0 { - c.Ui.Error("This command requires no arguments.") + c.Ui.Error(uiMessageNoArguments) c.Ui.Error(commandErrorText(c)) return 1 } diff --git a/command/quota_list.go b/command/quota_list.go index 32be5fd07..f93d71a7d 100644 --- a/command/quota_list.go +++ b/command/quota_list.go @@ -74,7 +74,7 @@ func (c *QuotaListCommand) Run(args []string) int { // Check that we got no arguments args = flags.Args() if l := len(args); l != 0 { - c.Ui.Error("This command takes no arguments") + c.Ui.Error(uiMessageNoArguments) c.Ui.Error(commandErrorText(c)) return 1 } diff --git a/command/recommendation_list.go b/command/recommendation_list.go index 4659b13e2..87f5662d6 100644 --- a/command/recommendation_list.go +++ b/command/recommendation_list.go @@ -94,7 +94,7 @@ func (r *RecommendationListCommand) Run(args []string) int { } if args = flags.Args(); len(args) > 0 { - r.Ui.Error("This command takes no arguments") + r.Ui.Error(uiMessageNoArguments) r.Ui.Error(commandErrorText(r)) } diff --git a/command/scaling_policy_list.go b/command/scaling_policy_list.go index e1a95a94d..4fd205049 100644 --- a/command/scaling_policy_list.go +++ b/command/scaling_policy_list.go @@ -93,7 +93,7 @@ func (s *ScalingPolicyListCommand) Run(args []string) int { } if args = flags.Args(); len(args) > 0 { - s.Ui.Error("This command takes no arguments") + s.Ui.Error(uiMessageNoArguments) s.Ui.Error(commandErrorText(s)) return 1 } diff --git a/command/sentinel_list.go b/command/sentinel_list.go index 4af39a9f5..eea145610 100644 --- a/command/sentinel_list.go +++ b/command/sentinel_list.go @@ -54,7 +54,7 @@ func (c *SentinelListCommand) Run(args []string) int { } if args = flags.Args(); len(args) > 0 { - c.Ui.Error("This command takes no arguments") + c.Ui.Error(uiMessageNoArguments) c.Ui.Error(commandErrorText(c)) } // Get the HTTP client diff --git a/command/server_members.go b/command/server_members.go index 90887ee56..271d9e118 100644 --- a/command/server_members.go +++ b/command/server_members.go @@ -91,7 +91,7 @@ func (c *ServerMembersCommand) Run(args []string) int { // Check for extra arguments args = flags.Args() if len(args) != 0 { - c.Ui.Error("This command takes no arguments") + c.Ui.Error(uiMessageNoArguments) c.Ui.Error(commandErrorText(c)) return 1 } diff --git a/command/service_list.go b/command/service_list.go index fd375c22b..b1b17308e 100644 --- a/command/service_list.go +++ b/command/service_list.go @@ -81,7 +81,7 @@ func (s *ServiceListCommand) Run(args []string) int { } if args = flags.Args(); len(args) > 0 { - s.Ui.Error("This command takes no arguments") + s.Ui.Error(uiMessageNoArguments) s.Ui.Error(commandErrorText(s)) return 1 } diff --git a/command/service_list_test.go b/command/service_list_test.go index 7a9d6616f..c460136ff 100644 --- a/command/service_list_test.go +++ b/command/service_list_test.go @@ -51,7 +51,7 @@ func TestServiceListCommand_Run(t *testing.T) { // Run the command with some random arguments to ensure we are performing // this check. must.One(t, cmd.Run([]string{"-address=" + url, "pretty-please"})) - must.StrContains(t, ui.ErrorWriter.String(), "This command takes no arguments") + must.StrContains(t, ui.ErrorWriter.String(), uiMessageNoArguments) ui.ErrorWriter.Reset() // Create a test job with a Nomad service. diff --git a/command/setup_consul.go b/command/setup_consul.go index 2b043ecf6..dc0d6aee0 100644 --- a/command/setup_consul.go +++ b/command/setup_consul.go @@ -120,7 +120,7 @@ func (s *SetupConsulCommand) Run(args []string) int { // Check that we got no arguments. if len(flags.Args()) != 0 { - s.Ui.Error("This command takes no arguments") + s.Ui.Error(uiMessageNoArguments) s.Ui.Error(commandErrorText(s)) return 1 } diff --git a/command/setup_vault.go b/command/setup_vault.go index b90327d90..b890c9f23 100644 --- a/command/setup_vault.go +++ b/command/setup_vault.go @@ -159,7 +159,7 @@ func (s *SetupVaultCommand) Run(args []string) int { // Check that we got no arguments. if len(flags.Args()) != 0 { - s.Ui.Error("This command takes no arguments") + s.Ui.Error(uiMessageNoArguments) s.Ui.Error(commandErrorText(s)) return 1 } diff --git a/command/system_gc.go b/command/system_gc.go index 0a9979e3a..5f0afb95d 100644 --- a/command/system_gc.go +++ b/command/system_gc.go @@ -51,7 +51,7 @@ func (c *SystemGCCommand) Run(args []string) int { } if args = flags.Args(); len(args) > 0 { - c.Ui.Error("This command takes no arguments") + c.Ui.Error(uiMessageNoArguments) c.Ui.Error(commandErrorText(c)) } diff --git a/command/system_reconcile_summaries.go b/command/system_reconcile_summaries.go index 86d9e516e..51af6d0ef 100644 --- a/command/system_reconcile_summaries.go +++ b/command/system_reconcile_summaries.go @@ -51,7 +51,7 @@ func (c *SystemReconcileSummariesCommand) Run(args []string) int { } if args = flags.Args(); len(args) > 0 { - c.Ui.Error("This command takes no arguments") + c.Ui.Error(uiMessageNoArguments) c.Ui.Error(commandErrorText(c)) } diff --git a/command/volume_snapshot_list.go b/command/volume_snapshot_list.go index 9b98f33af..1f2ccf56c 100644 --- a/command/volume_snapshot_list.go +++ b/command/volume_snapshot_list.go @@ -107,7 +107,7 @@ func (c *VolumeSnapshotListCommand) Run(args []string) int { args = flags.Args() if len(args) > 0 { - c.Ui.Error("This command takes no arguments") + c.Ui.Error(uiMessageNoArguments) c.Ui.Error(commandErrorText(c)) return 1 }