consul/command
Frank Schroeder a49711b8bf config: refactor commands to print help for flags (#3536)
This patch refactors the commands that use the mitchellh/cli library to
populate the command line flag set in both the Run() and the Help()
method. Earlier versions of the mitchellh/cli library relied on the
Run() method to populuate the flagset for generating the usage screen.
This has changed in later versions and was previously solved with a
small monkey patch to the library to restore the old behavior.

However, this makes upgrading the library difficult since the patch has
to be restored every time.

This patch addresses this by moving the command line flags into an
initFlags() method where appropriate and also moving all variables for
the flags from the Run() method into the command itself.

Fixes #3536
2017-10-18 00:08:45 +02:00
..
agent.go config: refactor commands to print help for flags (#3536) 2017-10-18 00:08:45 +02:00
agent_test.go Enforce json or hcl extension to Consul config files, updated unit tests 2017-09-25 17:17:12 -05:00
base.go config: refactor commands to print help for flags (#3536) 2017-10-18 00:08:45 +02:00
catalog_command.go config: refactor commands to print help for flags (#3536) 2017-10-18 00:08:45 +02:00
catalog_command_test.go Add catalog CLI functions (#3204) 2017-07-14 12:45:08 -07:00
catalog_list_datacenters.go config: refactor commands to print help for flags (#3536) 2017-10-18 00:08:45 +02:00
catalog_list_datacenters_test.go New config parser, HCL support, multiple bind addrs (#3480) 2017-09-25 11:40:42 -07:00
catalog_list_nodes.go config: refactor commands to print help for flags (#3536) 2017-10-18 00:08:45 +02:00
catalog_list_nodes_test.go New config parser, HCL support, multiple bind addrs (#3480) 2017-09-25 11:40:42 -07:00
catalog_list_services.go config: refactor commands to print help for flags (#3536) 2017-10-18 00:08:45 +02:00
catalog_list_services_test.go New config parser, HCL support, multiple bind addrs (#3480) 2017-09-25 11:40:42 -07:00
commands.go config: refactor commands to print help for flags (#3536) 2017-10-18 00:08:45 +02:00
event.go config: refactor commands to print help for flags (#3536) 2017-10-18 00:08:45 +02:00
event_test.go New config parser, HCL support, multiple bind addrs (#3480) 2017-09-25 11:40:42 -07:00
exec.go config: refactor commands to print help for flags (#3536) 2017-10-18 00:08:45 +02:00
exec_test.go Clean up subprocess handling and make shell use optional (#3509) 2017-10-04 16:48:00 -07:00
force_leave.go config: refactor commands to print help for flags (#3536) 2017-10-18 00:08:45 +02:00
force_leave_test.go New config parser, HCL support, multiple bind addrs (#3480) 2017-09-25 11:40:42 -07:00
info.go config: refactor commands to print help for flags (#3536) 2017-10-18 00:08:45 +02:00
info_test.go New config parser, HCL support, multiple bind addrs (#3480) 2017-09-25 11:40:42 -07:00
join.go config: refactor commands to print help for flags (#3536) 2017-10-18 00:08:45 +02:00
join_test.go New config parser, HCL support, multiple bind addrs (#3480) 2017-09-25 11:40:42 -07:00
keygen.go config: refactor commands to print help for flags (#3536) 2017-10-18 00:08:45 +02:00
keygen_test.go pkg refactor 2017-06-10 18:52:45 +02:00
keyring.go config: refactor commands to print help for flags (#3536) 2017-10-18 00:08:45 +02:00
keyring_test.go New config parser, HCL support, multiple bind addrs (#3480) 2017-09-25 11:40:42 -07:00
kv_command.go config: refactor commands to print help for flags (#3536) 2017-10-18 00:08:45 +02:00
kv_command_test.go test: run command tests in parallel 2017-05-31 00:29:25 +02:00
kv_delete.go config: refactor commands to print help for flags (#3536) 2017-10-18 00:08:45 +02:00
kv_delete_test.go New config parser, HCL support, multiple bind addrs (#3480) 2017-09-25 11:40:42 -07:00
kv_export.go config: refactor commands to print help for flags (#3536) 2017-10-18 00:08:45 +02:00
kv_export_test.go New config parser, HCL support, multiple bind addrs (#3480) 2017-09-25 11:40:42 -07:00
kv_get.go config: refactor commands to print help for flags (#3536) 2017-10-18 00:08:45 +02:00
kv_get_test.go New config parser, HCL support, multiple bind addrs (#3480) 2017-09-25 11:40:42 -07:00
kv_import.go config: refactor commands to print help for flags (#3536) 2017-10-18 00:08:45 +02:00
kv_import_test.go New config parser, HCL support, multiple bind addrs (#3480) 2017-09-25 11:40:42 -07:00
kv_put.go config: refactor commands to print help for flags (#3536) 2017-10-18 00:08:45 +02:00
kv_put_test.go New config parser, HCL support, multiple bind addrs (#3480) 2017-09-25 11:40:42 -07:00
leave.go config: refactor commands to print help for flags (#3536) 2017-10-18 00:08:45 +02:00
leave_test.go New config parser, HCL support, multiple bind addrs (#3480) 2017-09-25 11:40:42 -07:00
lock.go config: refactor commands to print help for flags (#3536) 2017-10-18 00:08:45 +02:00
lock_test.go Clean up subprocess handling and make shell use optional (#3509) 2017-10-04 16:48:00 -07:00
maint.go config: refactor commands to print help for flags (#3536) 2017-10-18 00:08:45 +02:00
maint_test.go New config parser, HCL support, multiple bind addrs (#3480) 2017-09-25 11:40:42 -07:00
members.go config: refactor commands to print help for flags (#3536) 2017-10-18 00:08:45 +02:00
members_test.go New config parser, HCL support, multiple bind addrs (#3480) 2017-09-25 11:40:42 -07:00
monitor.go config: refactor commands to print help for flags (#3536) 2017-10-18 00:08:45 +02:00
operator.go pkg refactor 2017-06-10 18:52:45 +02:00
operator_autopilot.go config: refactor commands to print help for flags (#3536) 2017-10-18 00:08:45 +02:00
operator_autopilot_get.go config: refactor commands to print help for flags (#3536) 2017-10-18 00:08:45 +02:00
operator_autopilot_get_test.go New config parser, HCL support, multiple bind addrs (#3480) 2017-09-25 11:40:42 -07:00
operator_autopilot_set.go config: refactor commands to print help for flags (#3536) 2017-10-18 00:08:45 +02:00
operator_autopilot_set_test.go New config parser, HCL support, multiple bind addrs (#3480) 2017-09-25 11:40:42 -07:00
operator_autopilot_test.go test: run command tests in parallel 2017-05-31 00:29:25 +02:00
operator_raft.go command: simplify 'operator raft' 2017-10-05 17:40:57 +02:00
operator_raft_list.go config: refactor commands to print help for flags (#3536) 2017-10-18 00:08:45 +02:00
operator_raft_list_test.go command: drop legacy 'operator raft' tests 2017-10-05 17:56:16 +02:00
operator_raft_remove.go config: refactor commands to print help for flags (#3536) 2017-10-18 00:08:45 +02:00
operator_raft_remove_test.go command: drop legacy 'operator raft' tests 2017-10-05 17:56:16 +02:00
operator_raft_test.go pkg refactor 2017-06-10 18:52:45 +02:00
operator_test.go test: run command tests in parallel 2017-05-31 00:29:25 +02:00
reload.go config: refactor commands to print help for flags (#3536) 2017-10-18 00:08:45 +02:00
reload_test.go New config parser, HCL support, multiple bind addrs (#3480) 2017-09-25 11:40:42 -07:00
rtt.go config: refactor commands to print help for flags (#3536) 2017-10-18 00:08:45 +02:00
rtt_test.go config: refactor commands to print help for flags (#3536) 2017-10-18 00:08:45 +02:00
snapshot_command.go config: refactor commands to print help for flags (#3536) 2017-10-18 00:08:45 +02:00
snapshot_command_test.go test: run command tests in parallel 2017-05-31 00:29:25 +02:00
snapshot_inspect.go config: refactor commands to print help for flags (#3536) 2017-10-18 00:08:45 +02:00
snapshot_inspect_test.go New config parser, HCL support, multiple bind addrs (#3480) 2017-09-25 11:40:42 -07:00
snapshot_restore.go config: refactor commands to print help for flags (#3536) 2017-10-18 00:08:45 +02:00
snapshot_restore_test.go New config parser, HCL support, multiple bind addrs (#3480) 2017-09-25 11:40:42 -07:00
snapshot_save.go config: refactor commands to print help for flags (#3536) 2017-10-18 00:08:45 +02:00
snapshot_save_test.go config: refactor commands to print help for flags (#3536) 2017-10-18 00:08:45 +02:00
util_test.go build: make tests independent of build tags 2017-08-30 13:40:18 +02:00
util_unix.go command: fix Windows build 2015-01-25 05:00:52 +01:00
util_windows.go docs: describe child process handling on Windows for lock command 2015-01-25 11:42:29 +01:00
validate.go config: refactor commands to print help for flags (#3536) 2017-10-18 00:08:45 +02:00
validate_test.go New config parser, HCL support, multiple bind addrs (#3480) 2017-09-25 11:40:42 -07:00
version.go New config parser, HCL support, multiple bind addrs (#3480) 2017-09-25 11:40:42 -07:00
version_test.go test: run command tests in parallel 2017-05-31 00:29:25 +02:00
watch.go config: refactor commands to print help for flags (#3536) 2017-10-18 00:08:45 +02:00
watch_test.go New config parser, HCL support, multiple bind addrs (#3480) 2017-09-25 11:40:42 -07:00