Commit Graph

1174 Commits

Author SHA1 Message Date
Michael Klishin df5db4ec1b Validate log level values, format unsupported level errors in a more human-friendly way 2018-11-29 00:20:41 +08:00
Luke Bakken 0e7608083b Add command to set log level
Fixes #276
2018-11-27 15:49:11 -08:00
Luke Bakken 8ab22299a8 Document --no-table-headers
Fixes #274

Switch no_table_headers to table_headers

update tests

Integrate --silent
2018-11-19 15:25:36 -08:00
Michael Klishin a3658df971 Merge pull request #272 from rabbitmq/idempotent-stop
Make stop idempotent using --idempotent flag
2018-11-01 23:47:07 +03:00
Michael Klishin 6416d745ed Update tests
[#161309687]
2018-11-01 23:46:32 +03:00
Luke Bakken 2f16936e36 Merge pull request #271 from rabbitmq/rabbitmq-cli-270
Ensure cli name ends with correct hostname
2018-11-01 09:31:43 -07:00
Diana Corbacho b8ab5f9b01 Rename ignore-stopped flag to idempotent
[#161309687]
2018-11-01 16:18:38 +00:00
Diana Corbacho 68d901bc3a Make stop idempotent using --ignore-stopped flag
[#161309687]
2018-11-01 14:22:13 +00:00
Daniil Fedotov 915004de25 Make CSV formatter return a string from format_output
By default CSV.encode returns a stream. Plain-value output does not
support streams.
2018-11-01 10:22:56 +00:00
Luke Bakken 933f4476f5 Improve scenario where inet:get_rc/0 does not return domain info 2018-10-31 19:33:10 -07:00
Luke Bakken 585bdacba2 Ensure cli name ends with correct hostname
If longnames are in use, this also ensures that the domain (if known) is appended to the CLI node name

CLI node names will be based on RabbitMQ host names

Fixes #270
2018-10-31 13:33:54 -07:00
Michael Klishin 36ad6dfdb5 Merge pull request #269 from rabbitmq/rabbitmq-cli-267
rabbitmq-diagnostics: make cipher_suites default to --openssl-format
2018-10-30 07:06:57 +03:00
Michael Klishin 7a4e7c403f Use a custom formatter for cipher_suites
There are effectively two separate formatters used:

 * The String one for --openssl-format
 * Command-joined Inspect for --erlang-format

This implementation is more involved than using :io_lib:format/2
on a collection but it fits the run/output/print framework every
command uses.

References #267.
2018-10-30 06:58:07 +03:00
Luke Bakken 3c3ae2afeb Output in erlang term format that can be pasted into a config file 2018-10-29 16:43:54 -07:00
Michael Klishin 582fa06686 More warnings 2018-10-30 00:51:35 +03:00
Michael Klishin 152395c30b Squash a warning 2018-10-30 00:33:15 +03:00
Michael Klishin 875c7827f6 rabbitmq-diagnostics: make cipher_suites default to --openssl-format
And introduce --erlang-format. They are mutually exclusive.

Closes #267.
[#161435591]
2018-10-28 23:31:39 +03:00
Daniil Fedotov 19a58551b3 Improve error reporting for quorum queues commands.
Validate that the rabbit app is runninig.
Format error when trying to access a classic queue.
Minor refactorings.
2018-10-26 15:20:34 +01:00
Diana Corbacho c9d9dc58a8 Delete quorum member command
[#157481599]
2018-10-26 14:50:36 +01:00
Diana Corbacho 357cd5c1b6 Add quorum queue member command
[#157481599]
2018-10-26 14:50:36 +01:00
Diana Corbacho 6bda3873d6 Add quorum status command to report local ra state
[#157146500]
2018-10-26 14:50:36 +01:00
Michael Klishin 5e54354fdf Make it possible to suppress table headers for list_* commands
Using --no-table-headers, per discussion with @dumbbell.
2018-10-24 16:43:58 +03:00
Michael Klishin f7d307dd30 Merge pull request #266 from rabbitmq/rabbitmq-server-1712
Output cipher suites one by one
2018-10-24 02:15:26 +03:00
Michael Klishin 1296e6824e Output cipher suites one by one
This is more useful to the users of the new config format.

References rabbitmq/rabbitmq-server#1712.

[#160792113]
2018-10-24 01:44:24 +03:00
Daniil Fedotov 222e486ca7 Add headers to the table formatter.
There were headers in 3.6 CLI which were not implemented when moving
to the new one.

Fixes #264
[#161326468]
2018-10-22 10:55:16 +01:00
Michael Klishin 312b6f57c4 Use the correct key name for plugin archive directory
[#160792758]
2018-10-03 17:05:07 +03:00
Michael Klishin 5ec71c18f3 Retrieve plugin directory and file information via Config
[#160792758]
2018-10-03 16:43:42 +03:00
Michael Klishin a85908aa30 Simplify clauses, make --offline more robust
[#160792758]
2018-10-02 15:34:20 +03:00
Michael Klishin 0defc87c20 Wording 2018-10-02 14:23:39 +03:00
Michael Klishin 3a30b45c5d Wording 2018-10-02 14:22:42 +03:00
Michael Klishin 1b56fc5957 New command: rabbitmq-plugins directories
Closes rabbitmq/rabbitmq-cli#261.

[#160792758]
2018-10-02 03:16:25 +03:00
Luke Bakken ad184bac68 Add global parameters to rabbbitmqctl report
Follow-up to #256
2018-08-27 14:38:26 -07:00
Jean-Sébastien Pédron 4f3b2d39bd RabbitMQ.CLI.Core.Parser: Set `allow_nonexistent_atoms` in OptionParser
There is a change of behavior in OptionParser between Elixir 1.6.x and
1.7.x. It's probably the deprecation documented in Elixir 1.7.0 release
notes:

    [OptionParser] Deprecate dynamic option parser mode that depended on
    atoms to be previously loaded and therefore behaved inconsistently

Setting the `allow_nonexistent_atoms` to true allows to restore the
behavior from Elixir 1.6.x, thus giving a consistent parsing with both
versions of Elixir.

[#159500280]
2018-08-03 13:17:09 +02:00
Ayanda Dube c88cfd940d Reduce code footprint on aliases 2018-07-23 06:06:18 +01:00
Ayanda Dube 4ee275cbcd Include policies and parameters in report command 2018-07-16 16:36:47 +01:00
Michael Klishin 40b40a6d42 Make the ping command available in rabbitmq-diagnostics as well
References #253.

[#158291890]
2018-06-13 00:38:02 +03:00
Michael Klishin 158dc0eb7e Wording 2018-06-13 00:37:17 +03:00
Michael Klishin b20418cb83 Pass current node as is_auth "argument"
To be closer to what net_adm:ping/1 does. The argument
is then ignored by net_kernel, though.

[#158291890]
2018-06-12 23:18:48 +03:00
Michael Klishin ee2b185db9 Introduce rabbitmqctl ping
See #253 for background.

[#158291890]
2018-06-12 16:47:54 +03:00
Michael Klishin 09e86fb73d New command: await_online_nodes <count> [--timeout <timeout>]
Closes #235.

[#156729133]
2018-05-29 16:01:03 +03:00
Michael Klishin 1ea1edf865 Explain why --timeout is on the global flag list 2018-03-09 20:32:02 +03:00
Michael Klishin 56991de0f3 Accept -t/--timeout before command name [again]
There are existing users (including RabbitMQ core tests) that
use that sequence because it was previously in the docs.

This relaxes command validation so that if a command-specific
flag overrides a global, we accept it as long as their types match.

Per discussion with @hairyhum.
2018-03-09 20:28:26 +03:00
Luke Bakken e99bc16428 Whitespace changes
See #236
2018-03-08 14:13:32 -08:00
Michael Klishin d96d0f6e22 Axe some [now] dead code 2018-03-08 18:25:33 +03:00
Daniil Fedotov aef04bef84 Show timeout in help messages only for commands supporting timeout.
Removed timeout from default parsing options. Now every command
has to specify timeout in it's own switches.
If a command has timeout in switches - there will be help displayed
for this option in usage output.
2018-03-07 18:28:21 +00:00
Daniil Fedotov 0c83c05ec1 Do not show timeout option for rabbitmq-plugins tool.
The rabbitmq-plugins tool does not respect timeout option.
2018-03-07 15:51:54 +00:00
Daniil Fedotov 8b33c646ed Command to delete a queue. 2018-03-07 15:20:18 +00:00
Michael Klishin ee1a651f6d Squash a warning 2018-02-22 23:59:06 +03:00
Luke Bakken e4505bb9a6 Ensure another string case is taken care of
If a user happens to set the following in rabbitmq-env-conf.bat, it will be matched:

set USE_LONGNAME="true"

Fixes rabbitmq/rabbitmq-server#1508
2018-02-20 15:05:28 -08:00
Michael Klishin fa5763e6c2 Format "plugins not found" errors better
References #241.

(cherry picked from commit 018c829e1e)
2018-02-13 21:49:57 +03:00
Luke Bakken 08c3100897 Add function clause for set: case
Fixes #241
2018-02-13 09:08:59 -08:00
Daniil Fedotov 97b1f21803 Optimise some commands by not starting erlang distribution
(cherry picked from commit cf23e45cf9)
2018-01-16 20:05:51 +03:00
Daniil Fedotov 97846fcf79 Add a callback to control erlang distribution.
The callback cab be used to disable distribution (offline commands)
or to have command-specific node name and distribution parameters.

(cherry picked from commit b5de2236ce)
2018-01-16 20:05:41 +03:00
Michael Klishin 3435bc66a5 Wording 2017-12-08 17:56:07 -08:00
Luke Bakken 81862adcab Fixing SetParameterCommand and tests
Fix code to fix test suite
2017-12-08 11:49:20 -08:00
Michael Klishin 747f953d76 Remove an unused variable 2017-11-28 20:12:48 +03:00
Michael Klishin 404f55ecc9 Pick the max of totals, just like HTTP API reporter does 2017-11-28 19:47:51 +03:00
Michael Klishin 5cbb4039a6 Cosmetics 2017-11-28 19:28:34 +03:00
Michael Klishin a404c0b8c5 Adapt rabbitmq-diagnostics memory_breakdown to server master
Specifically to https://github.com/rabbitmq/rabbitmq-server/pull/1404.

Closes #228.

[#153217000]
2017-11-28 19:12:14 +03:00
Michael Klishin 82d5fcd804 Merge pull request #227 from rabbitmq/rabbitmq-cli-226
Fix rabbitmq-plugins enable/disable/set behavior for --online flag.
2017-11-28 00:04:18 +03:00
Michael Klishin e5fd1ccc5a Cosmetics 2017-11-27 23:39:14 +03:00
Daniil Fedotov 32cf46e5c8 Fix rabbitmq-plugins enable/disable/set behavior for --online flag.
If flag is set to `--online` the commands should fail if node is not
running.
If flag is not set, they should fallback to offline mode if the
node is not running.
This corresponds to the rabbitmq-plugins.8 manpage.

Made validation aware of online flag.
Define best_effort mode to fallback if node is not running.
Requires rabbitmq/rabbitmq-server#1433

Fixes #226
[#153184802]
2017-11-27 18:49:08 +00:00
Michael Klishin 9cbfbc21a0 Correctly format the list of missing plugins
Closes #224.
[#153141065]
2017-11-27 18:32:53 +03:00
Michael Klishin 1103c82a87 Don't require RabbitMQ node to be running for `rabbitmq-plugins list'
This extra validation wasn't intentional and turns out to be inconvenient
for provisioning and automation projects such as BOSH releases and Docker images.
2017-09-05 13:45:17 -07:00
Daniil Fedotov 32bd206ff9 Remove -l alias from help_command. It iss conflicting with default alias 2017-08-18 16:13:20 +01:00
Michael Klishin 206a5fb93c Squash a warning 2017-08-15 12:53:31 +03:00
Daniil Fedotov 8bc0b68f4e Change validation for the force_boot command 2017-08-14 19:20:32 +01:00
Daniil Fedotov 7b2de34620 Error message if a command has duplicate global switches 2017-08-14 17:14:41 +01:00
Daniil Fedotov 141e845fab Remove duplicate global switches. 2017-08-14 17:14:41 +01:00
Daniil Fedotov e34bfe2297 Merge branch 'master' into rabbitmq-cli-214-take-two 2017-08-14 14:40:35 +01:00
Daniil Fedotov 568874033d Run dialyzer tests. Fix warnings.
Some types were named wrongly (list(), map())
MapSet cannot be matched to be empty. `%MapSet{}` only matches the type.
2017-08-14 14:36:38 +01:00
Daniil Fedotov 3e30b8a4f3 Enable rabbit app validation for list_parameters and clear_permissions. Disable the validation for shutdown 2017-08-14 11:59:35 +01:00
Luke Bakken cb65a340d5 Add single quotes around commands given in output 2017-08-11 17:00:20 -07:00
Luke Bakken 006ff6a259 Remove extra whitespace 2017-08-11 14:57:18 -07:00
Michael Klishin b00e648b9c Extend execution environment validation to more commands
This also re-formats a bunch of commands to follow the same
order for the following functions:

 * merge_defaults/2
 * validate/2
 * validate_execution_environment/2
 * run/2
2017-08-11 18:06:30 +03:00
Michael Klishin ea1078fc5f Update command type specs 2017-08-11 18:06:16 +03:00
Michael Klishin 6b007ab1cf Make sure we format errors here 2017-08-11 18:04:00 +03:00
Michael Klishin fa0515911f These commands don't really require the rabbit app to be running 2017-08-11 14:37:02 +03:00
Michael Klishin 586a557096 Add a type spec for validate_execution_environment/2 2017-08-11 14:15:36 +03:00
Michael Klishin 8cee00231b Introduce RabbitMQ.CLI.Core.RequiresRabbitApp{Running,Stopped}
and apply them to a subset of commands.
2017-08-11 02:23:53 +03:00
Michael Klishin efe8725f3c Merge branch 'master' into rabbitmq-cli-214-take-two 2017-08-10 14:21:42 +03:00
Daniil Fedotov e8c73d9bea Merge branch 'master' into rabbitmq-cli-207 2017-08-09 14:36:07 +01:00
Daniil Fedotov de10e4f5a7 Different list of info items for unresponsive queues 2017-08-09 14:34:01 +01:00
Daniil Fedotov 035e7305ac Merge pull request #218 from rabbitmq/timeout_list_queues
Set a timeout on list_queues and a warning if unresponsive ones are found
2017-08-09 17:24:40 +04:00
Michael Klishin 2eda5ea31c Make sure *validation_error_output/2 functions are used correctly 2017-08-09 15:52:04 +03:00
Michael Klishin 0031c4fdf6 Make validate/2 and validate_execution_environment/2 use the same tuple tag
Per discussion with @hairyhum.
2017-08-09 01:11:14 +03:00
Michael Klishin afa605b3e9 Merge branch 'master' into rabbitmq-cli-214-take-two
Conflicts:
	lib/rabbitmq/cli/plugins/commands/enable_command.ex
2017-08-08 19:14:07 +03:00
Michael Klishin 82ebcfafeb Assume this match is exhaustive 2017-08-08 19:12:19 +03:00
Michael Klishin c227843e32 Make validate_execution_environment/2 use a different tuple tag for failures
Per discussion with @hairyhum.
2017-08-08 18:29:04 +03:00
Diana Corbacho 738f667716 Override timeout 2017-08-08 10:01:32 +02:00
Michael Klishin 6c70863dcf rabbitmq-plugins: refactor to validate_execution_environment/2 and R.C.C.Validators.chain/2 2017-08-08 03:21:07 +03:00
Diana Corbacho 9d6dfddb3e Set a timeout on list_queues and a warning if unresponsive ones are found
Related to rabbitmq-cli#207
2017-08-07 17:38:24 +02:00
Michael Klishin 15565ec1d7 rabbitmq-plugins set: switch to validate_execution_environment/2 2017-08-07 16:44:19 +03:00
Diana Corbacho 829a918c5a Use info items to list unresponsive queues
rabbitmq-cli#207
[#149059849]
2017-08-07 15:08:33 +02:00
Michael Klishin 2e64c90913 rabbitmq-plugins enable: switch to validate_execution_environment/2 2017-08-07 16:04:30 +03:00
Michael Klishin 770258ea65 rabbitmq-plugins disable: switch to validate_execution_environment/2 2017-08-07 14:47:17 +03:00
Michael Klishin 4b6978f26d Squash a couple more warnings 2017-08-04 22:41:12 +03:00
Michael Klishin e9fa801d6f Update restart_vhost usage 2017-08-04 21:45:22 +03:00
Michael Klishin 6da66de40a forget_cluster_node: switch to validate_execution_environment/2 2017-08-04 19:15:53 +03:00
Michael Klishin 8e9b114eac Fold execution environment validation into a single optional fn
While at it, move Ctl.Validators => Core.Validators.

If the function is not defined we skip validation. Note that
individual commands need to be revisited and refactored to use
this mechanism; this is yet to come.

Per discussion with @hairyhum and @lukebakken.
2017-08-04 18:40:17 +03:00
Michael Klishin d92b78b49e Simplify, explain 2017-08-04 15:20:57 +03:00
Michael Klishin 032482cec6 Factor in rabbit app state and execution env validation
This introduces two other "validation steps" that have little or nothing
to do with CLI argument validation.

Per discussion with @hairyhum.
2017-08-04 15:08:37 +03:00
Michael Klishin 9919700303 Inline validate_and_run_command/3 for greater flexibility
This way we can inject more "validation steps" between validate/2
return and command execution, such as checking whether the rabbit app
is running (or not running) on the remote node.

While at it, group functions that are used in a chain.
2017-08-04 14:09:37 +03:00
Daniil Fedotov 10bb587d61 The command to restart a vhost.
The command will attempt to restart a vhost.
If restarted successfully, return exit code 0
If the vhost is already started, return exit code 0 and notify that it's already started.
If there is an error restarting, return exit code 70 and the error
Part of rabbitmq/rabbitmq-server#1321
[#149484305]
2017-08-04 11:32:40 +01:00
Daniil Fedotov a7bd5811d0 Change state in vhost info to cluster_state 2017-08-01 14:56:21 +01:00
Daniil Fedotov 59c1a54cad Do not format errors using to_string. Let rabbitmqctl core do the formatting 2017-07-31 15:57:10 +01:00
Diana Corbacho 3c6a59079c Command to report unresponsive queues
rabbitmq-cli#207
[#149059849]
2017-07-27 17:50:52 +02:00
Karl Nilsson d4e701bb3d Merge pull request #211 from rabbitmq/rabbitmq-management-446
Report vhost status on list_vhosts command
2017-07-25 18:38:15 +01:00
Diana Corbacho 05469e4bad Report vhost status on list_vhosts command
rabbitmq-management#446
[#149398495]
2017-07-25 11:47:07 +01:00
Michael Klishin bd96454992 Merge pull request #210 from rabbitmq/rabbitmq-server-1296
Do not crash command loading if unable to read enabled plugins file.
2017-07-24 22:10:43 +03:00
Michael Klishin 540b5bd170 Copy 2017-07-24 22:07:46 +03:00
Daniil Fedotov 306b7574e4 Do not crash command loading if unable to read enabled plugins file.
Some distributions set no permissions to read the enabled plugins
file location. This can cause a crash when running not as root or
rabbitmq user.
It was decided that plugins commands can be skipped when printing
the help message if the user have no access to the enabled plugins
file.
The warning message will be displayed in that case.

Addresses https://github.com/rabbitmq/rabbitmq-server/issues/1296
[#149079123]
2017-07-24 17:28:12 +01:00
Michael Klishin 6926a3a9a8 Recompile pid_regex at runtime, too 2017-07-20 17:51:30 +03:00
kjnilsson 54f417b93f Recompile regexes at runtime.
Because the regex engine may change between OTP versions it is necessary
to recompile any compiled regexes at runtime in case the engine is not
compatible.

[#149227527]
2017-07-20 14:08:43 +01:00
Michael Klishin a33b26105c Supress banners for machine readable format
Namely JSON and CSV.

Fixes #205.
2017-07-14 18:08:17 +03:00
Michael Klishin 4383c3e280 Tests, refactoring 2017-07-14 03:33:46 +03:00
Michael Klishin d4bf287a90 output formatter now can rely on command defaults 2017-07-13 15:53:18 +03:00
Michael Klishin 3f21e0fac1 Make sure that command-provided defaults are available to output formatting fns 2017-07-13 15:46:31 +03:00
Michael Klishin f5ddac1f22 Merge branch 'master' into memory_breakdown_command 2017-07-13 03:50:03 +03:00
Michael Klishin 330d8a4eda rabbitmq-diagnostics memory_breakdown: WIP 2017-07-13 03:45:01 +03:00
Michael Klishin df726906a2 Make arguments in this fn head easier to identify 2017-07-12 13:08:20 +03:00
Michael Klishin 7361c7d54a Merge branch 'master' into rabbitmq-cli-202 2017-07-12 13:04:07 +03:00
Michael Klishin 8745bdf5df Squash a warning 2017-07-12 13:03:30 +03:00
Diana Corbacho 1be262d496 Avoid streaming if no nodes are available
rabbitmq-cli-202
[#148733373]
2017-07-12 10:35:32 +01:00
Michael Klishin de41a1081a Introduce rabbitmq-diagnostics erlang_version 2017-07-11 15:28:12 +03:00
Michael Klishin c26a7a5909 Introduce rabbitmq-diagnostics server_version 2017-07-11 13:26:05 +03:00
Michael Klishin 310ffe159e Wording 2017-07-04 22:41:32 +03:00
Michael Klishin ca20f8a0d6 Make CLI tools diagnostics message more detailed
Our current message is informative enough but it ends with a "nodedown".
Emperical evidence suggests that once a user sees it, they stop reading.
Providing a hint that there will be diagnostics output below is step 1.

Step 2 is improving the diagnostics section. It now

  * Calls out three most common groups of issues explicitly
  * Suggests what documentation guides can contain helpful information

There are rabbitmq-server and rabbitmq-common commits that make
similar improvements to the server-supplied part of the diagnostics
message.

Per discussion with the team.
2017-07-04 22:34:39 +03:00
Michael Klishin 65346cde82 Use rabbit_nodes_common here 2017-07-04 22:24:19 +03:00
Michael Klishin a9bd603352 Squash a warning 2017-07-04 22:24:00 +03:00
Michael Klishin 09eee9fd53 Improve error messages 2017-07-03 16:39:04 +03:00
Michael Klishin 5774bc64e5 Merge branch 'master' into rabbitmq-cli-encode-commands 2017-07-03 15:52:07 +03:00
Daniil Fedotov 58304ffc95 Split encode command tests to separate commands 2017-07-03 12:11:34 +01:00
Michael Klishin 88629421d1 Whitespace 2017-06-30 14:44:35 +03:00
Michael Klishin b7b5223a39 list_vhost_limits: handle errors before serialising results
Also update tests and format no_such_vhost errors in a more sensible
way.
2017-06-30 14:43:09 +03:00
Daniil Fedotov c40368fe02 Split encode command to encode, decode, list_ciphers and list_hashes commands
[#147861659]
2017-06-28 17:19:42 +01:00
Daniil Fedotov a4b452545b Improve formatting for list_vhost_limits command.
Format limits as JSON.
Make sure vhost field printed before limits.
2017-06-27 17:28:37 +01:00
Jean-Sébastien Pédron 66a7ee4cab distribution.ex: ensure_epmd() was moved to rabbit_nodes_common
[#147436507]
2017-06-26 19:28:52 +02:00
Daniil Fedotov ee8c2f133c Support Elixir-1.5.0-rc.0 2017-06-26 11:59:46 +01:00
Michael Klishin 2ac997fd89 Merge pull request #200 from rabbitmq/rabbitmq-cli-199
Handle error in `rabbit_mnesia:cluster_nodes/1` on cluster_status command
2017-06-16 19:48:43 +03:00
Michael Klishin 6410ba0272 Fix compiler warnings that hinted at a typo in atom name
First spotted by @lbakken.
2017-06-16 19:43:09 +03:00
Michael Klishin a1e07c72f1 Merge pull request #198 from rabbitmq/rabbitmq-cli-197
Use the output of multirpc to report the down or timed out nodes
2017-06-16 19:40:38 +03:00
Diana Corbacho beacfe998a Handle error in `rabbit_mnesia:cluster_nodes/1` on cluster_status command
If the error is ignored, an Enum exception is triggered which is not
meaningful for the final user. Notifying that something is wrong accessing
to Mnesia files provides a hint. Can be eventually reproduced while
the node is restarting.

rabbitmq-cli#199
2017-06-16 16:51:57 +01:00
Michael Klishin 31822baf8c Revert "Revert "Compile""
This reverts commit 7908b17f01.

Test failures were due to something tripping up test node start,
not the change in ec695461ab.
2017-06-16 17:55:31 +03:00
Michael Klishin 7908b17f01 Revert "Compile"
This reverts commit ec695461ab.

This introduced test failures.
2017-06-16 17:35:57 +03:00
Michael Klishin ec695461ab Compile 2017-06-16 17:34:29 +03:00
Diana Corbacho cb2b3bc667 Fix timed out message 2017-06-16 14:54:33 +01:00
Diana Corbacho dfa9827135 Use the output of multirpc to report the down or timed out nodes
Most commands do rpc's only to the target node, but join_cluster
triggers an rpc between nodes. If the rpc to the remote down returns
down/timeout, we must use that value to run the diagnostics.
Using the node from command options in diagnostics will report as down
the wrong node.

rabbitmq-cli#197
2017-06-16 12:41:11 +01:00
Daniil Fedotov 81c1f9461f Add an output formatter for report command
Report command executes other commands, so it's formatter
cannot be changed using command line argument.
Report formatter will format each command output with this command
default formatter.
2017-06-15 16:32:39 +01:00
Daniil Fedotov 3693daf693 Add functions to get info keys to list_* commands 2017-06-15 16:31:32 +01:00
Daniil Fedotov c31989de08 Change banner for list_queues and list_exchanges to show vhost 2017-06-15 16:03:38 +01:00
Michael Klishin 5409c37f3e Merge pull request #194 from rabbitmq/rabbitmq-cli-193
Check `rabbit_mnesia:status` return value
2017-06-15 16:38:22 +03:00
Michael Klishin a84c4b3405 Merge pull request #195 from rabbitmq/naming
Rename <user> to <username> to standarise all rabbitmqctl commands
2017-06-15 16:37:55 +03:00
Diana Corbacho 5bdfcc575d Display --local option in list_queues help 2017-06-15 12:42:02 +01:00
Diana Corbacho d6686e40f6 Rename <user> to <username> to standarise all rabbitmqctl commands
Most commands use <username> in the help description
2017-06-15 12:06:32 +01:00
Diana Corbacho 68698d34d2 Check `rabbit_mnesia:status` return value
Ensures the error is returned and not used later on.

rabbitmq-cli#193
2017-06-14 17:00:18 +01:00
kjnilsson 93b42d5e31 Log enabled and disabled plugins in offline mode.
This ensures that the enabled/disabled plugins are logged
in offline mode.

[#146384227]
2017-06-13 10:01:32 +01:00
Daniil Fedotov 858b79d603 Use plugins formatter as default formatter for plugins list command 2017-06-09 12:24:38 +01:00
Daniil Fedotov a3776bf9b8 Return :ok in validation. 2017-06-08 18:29:51 +01:00
Daniil Fedotov 1641ecbc11 Improve wait command.
Do not call await_startup on rabbitmq node, instead do it on
rabbitmqctl node, so even if net_ticktime is low, it won't fail
with nodedown.
2017-06-08 18:15:21 +01:00
Daniil Fedotov b802fcdf87 Do not try to connect to the RabbitMQ node before executing command
Commands are supposed to return bardpc errors, which are handled by output,
so there is no need to connect to the node before calling the run function.
2017-06-07 16:21:53 +01:00
Daniil Fedotov b8d6042046 Quiet mode for wait command will suppress log messages 2017-06-07 14:22:59 +01:00
Jean-Sébastien Pédron cd377eeb0f Merge branch 'rabbitmq-cli-wait-stages' 2017-06-07 13:42:36 +02:00
Daniil Fedotov 6b1fbb482c Change cluster node type to selected type 2017-06-06 18:43:38 +01:00
Daniil Fedotov a759eea11a Make wait take the actual function execution time to account 2017-06-06 18:11:25 +01:00
Daniil Fedotov 61eeab17c1 Callback for exec_command function to process output 2017-06-06 12:07:34 +01:00
Daniil Fedotov 27fc29914c Test exec command 2017-06-06 12:07:00 +01:00
Daniil Fedotov 5c98699a29 Add new test to check argument processing typical to multiple commands.
Check that merge_defaults does not fail on badmatch with arbitrary args.
Check that info keys can be a comma-separated list
2017-06-06 12:06:17 +01:00
Jean-Sébastien Pédron 975be0ccfb join_cluster_command: Format the `already_member` return value 2017-06-06 11:50:20 +02:00
Daniil Fedotov b4a8789ed1 Wait in stages.
Make wait command work in stages with timeouts.
First wait for a pid file to appear (times out)
Then wait for erlang distribution to start on the node (times out)
Then wait for application to be running in the node (does not time out)

Default timeout is set to 10 seconds, which should be enough to
write a pid file and start distribution.
2017-06-02 16:48:34 +01:00
Daniil Fedotov 6cf003ed03 Typo in info message 2017-06-02 14:35:52 +01:00
Daniil Fedotov 8ea044dd80 Do not match arguments in merge_defaults.
merge_defaults gets called before validate, so it should allow
any argument number.
2017-06-02 10:17:28 +01:00
Daniil Fedotov 51de5e0fea Less strict help arguments
Print command help even if there are more than 1 argument.
For example:
  rabbitmqctl help <command> <other args>
2017-06-02 10:17:28 +01:00
Daniil Fedotov 7fb2a1d797 Print result in trace_on/off commands 2017-06-02 10:17:28 +01:00
Daniil Fedotov 14cb785966 Unused clause 2017-06-02 10:17:28 +01:00
Daniil Fedotov 4c06bee5fe Unfold stream subcommand output in report command. 2017-06-02 10:17:28 +01:00
Daniil Fedotov be7ffd911d Do not stramify keyword lists (proplists) 2017-06-02 10:17:28 +01:00
Daniil Fedotov d1040ca11f Helper function to parse info_keys arguments 2017-06-02 10:17:28 +01:00
Daniil Fedotov 9b0ec73a0d Set default formatter for environment command to erlang 2017-06-02 10:17:28 +01:00
Michael Klishin 6c2cb2336f Explain 2017-05-31 23:24:58 +03:00
Daniil Fedotov ad3d016e4d Avoid formatting message of no peers discovered.
{:error, exit_ok(), message} is a trick to print a string
without formatting it first.
2017-05-31 17:17:07 +01:00
Daniil Fedotov 769fe8e712 Better error management with stream outputs from list_ commands.
Fixed incorrect tuple matching.
Added support for error codes and messages for timeout with value.
2017-05-24 13:28:51 +01:00
Daniil Fedotov 60deb8514d Improve error reporting.
badrpc errors are handled in Rabbitmqctl module.
Report errors from node discovery
Add helpers to skip errors in formatters.
2017-05-24 12:08:03 +01:00
Daniil Fedotov 719b75269c Fixing erlang and string formatters.
Erlang formatter had issues when formatting erlang strings, because
they were interpreted as streams. Now all streams are being converted
to lists and printed as is.
String formatter does not try to format with io_lib, instead it tries
to format using Elixir to_string.
2017-05-22 17:14:26 +01:00
Michael Klishin a10ecbdb7a This command belongs to diagnostics, not ctl 2017-04-30 01:27:44 +02:00
Michael Klishin 48f79daa09 Don't output backend information; declare a formatter instead of delegating to it 2017-04-30 01:25:27 +02:00
Gabriele Santomaggio 5b8cdf37a1 Rename list_discover_peers with discover_peers 2017-04-28 18:47:35 +02:00
Gabriele Santomaggio 4fa68912a4 Format result
Add Backend type
Add simple unit test
2017-04-28 18:12:04 +02:00
Gabriele Santomaggio 34e791851c Add case 2017-04-27 22:59:20 +02:00
Gabriele Santomaggio a875fe52ef Add list_discovery_peers command.
Command to report: :rabbit_peer_discovery, :discover_cluster_nodes
2017-04-27 12:16:10 +02:00
Michael Klishin 1805012f77 Merge branch 'master' into rabbitmq-cli-shutdown 2017-04-07 22:31:54 +02:00
Michael Klishin 987526d70f (c) year 2017-04-05 15:44:16 +03:00
Michael Klishin ac8b32f61a Merge branch 'master' into rabbitmq-cli-180
Conflicts:
	lib/rabbitmq/cli/core/distribution.ex
2017-04-05 15:03:52 +03:00
Daniil Fedotov 8ef4c404ab Do not import modules. Import only protocols and records.
Aliases is a convinient enough to reference elixir modules.
Imported functions can be confusing, especially mixed with aliases.
2017-04-05 11:59:54 +01:00
Daniil Fedotov 819d512038 Implement shutdown command 2017-04-04 19:23:50 +01:00
Daniil Fedotov 62a44ac641 Optimize rabbitmqctl startup.
Plugins dirs are added to ERL_LIBS by shell scripts, we try to load
enabled plugins first and scan plugins dir only if some of them
are not found.
When discovering plugins, we can load applications only for enabled ones.
EPMD can be started only after initial `net_kernel:start` call failed.
We don't need to discover all commands every time, only if a command is not
in the `rabbitmqctl` application modules.
[finishes #143025009]
2017-04-04 14:06:53 +01:00
Michael Klishin 61c3d0e9d0 Naming; make sure ensure_cookie/1 always returns :ok
erlang:set_cookie/2 returns true, not ok.
2017-04-04 15:11:41 +03:00
Daniil Fedotov 1e1cb92a44 Make it possible to specify erlang cookie from command line
Add new flag `--erlang-cookie` and environment variable `RABBITMQ_ERLANG_COOKIE`
to configure a cookie for CLI to connect to RabbitMQ node.
2017-04-03 14:46:26 +01:00
Daniil Fedotov 00a298961a Print diagnostics on nodedown error
[finishes #142492945]
2017-03-31 11:28:41 +01:00
Daniil Fedotov 05a2a18f52 Handle `eacces` errors in addition to `eperm` in `hipe_compile` command
`hipe_compile` command validation checks that directory can be created and
have permissions to write .beam files. System can return `eperm` or `eacces`
errors in different conditions, but the meaning of those errors is same.
2017-03-14 17:18:18 +00:00
Michael Klishin 2dc56b3737 hipe_compile: reject blank, non-existent paths and those with insufficient permissions
References #178.
2017-03-14 01:49:04 +03:00
Michael Klishin 95ea549472 rabbit app is loaded during validation; handle "already compiled" cases
References #178.
2017-03-13 21:21:15 +03:00
Michael Klishin f2f0c26e44 Finish hipe_compile command
This correctly handles the case where the rabbit app is
already loaded.

References #178.
2017-03-10 21:25:00 +03:00
Michael Klishin 34262f2161 ctl hipe_compile WIP
This command needs access to RabbitMQ modules and currently
propagation doesn't work as expected.
2017-03-10 15:30:50 +03:00
Michael Klishin ef98536ab4 rabbitmqctl hipe_compile WIP 2017-03-10 01:01:03 +03:00
Jean-Sébastien Pédron 89e12a1ac7 lib/rabbitmq/cli/plugins/plugins_helpers.ex: Remove dead code
The same function call is made the line after.
2017-02-28 16:16:27 +01:00
Jean-Sébastien Pédron 12c34a78c4 lib/rabbitmq/cli/plugins/plugins_helpers.ex: Use `deps` to filter plugins
... in validate_plugins(). This variable was computed but not used. The
initial `plugins` variable was used but it lacked dependencies.
2017-02-28 16:15:08 +01:00
Jean-Sébastien Pédron 1f68c5a89d Mark unused variables with '_'
Obviously, this fixes sevearl "unused variable" warnings.
2017-02-28 16:12:34 +01:00
Jean-Sébastien Pédron 3dd4ff27c6 lib/rabbitmq/cli/core/parser.ex: Remove dead code
OptionParser is already called inside parse_global_head() and the return
values are overwritten anyway. This fixes warnings about unused
variables.
2017-02-28 16:11:32 +01:00
Diana Corbacho 74ffe46fb3 Rename function 2017-02-27 16:23:57 +00:00
Diana Corbacho 87331bb95e Exclude applications that are not RabbitMQ plugins from the list of plugins 2017-02-27 14:52:40 +00:00
Michael Klishin 1aeedbe98e RABBITMQCTL_ALIASES => RABBITMQ_CLI_ALIASES_FILE
Per discussion with @hairyhum.
2017-02-21 17:51:17 +03:00
Daniil Fedotov 95fe5c96fd Document aliases. Improve eval command to accept bound arguments 2017-02-16 12:41:26 +00:00
Daniil Fedotov 2b4012127e Support aliases
Fixes #10

Loads aliases in "name = command_name [arguments and options]" format from --aliases-file
2017-02-15 18:03:45 +00:00
Daniil Fedotov 8efb8a32ab Do not use Mix in production code.
Fixes #174

Mix is not bundled into the escript file, so sould not
be used in the code.
2017-02-15 10:46:08 +00:00
Michael Klishin c4dab95dce Copy 2017-02-06 00:39:16 +03:00
Michael Klishin 696adc923d Copy 2017-02-06 00:35:20 +03:00
Michael Klishin 39f17b53ee Naming, Elixir code style 2017-02-06 00:02:30 +03:00
Arnaud Cogoluègnes 62cdd4d7fc Merge branch 'master' into rabbitmq-server-1085 2017-01-31 17:20:52 +01:00
Michael Klishin 2a9c24af2c Merge branch 'master' into rabbitmq-server-release-12 2017-01-27 18:33:19 +03:00
Jean-Sébastien Pédron 61d8bb836e Merge pull request #171 from rabbitmq/rabbitmq-cli-170
Validate enabled plugins version requirements
2017-01-27 16:29:04 +01:00
Daniil Fedotov 0e13568ec3 Move plugin validation from `validate` to `run` 2017-01-27 14:55:09 +00:00
Daniil Fedotov 77860364bb Merge branch 'master' into rabbitmq-server-release-12 2017-01-27 10:42:58 +00:00
Daniil Fedotov 8038f583e0 Validate all plugins if `all` flag is present 2017-01-26 16:21:44 +00:00
Daniil Fedotov df95a411c7 Format user_already_exists error 2017-01-26 12:33:56 +00:00
Daniil Fedotov 52ad0d2a39 Validate enabled plugins version requirements 2017-01-26 12:21:20 +00:00
Daniil Fedotov 04c1c2e2f9 Do not print "Command '' not found" for empty command 2017-01-25 15:24:47 +00:00
Daniil Fedotov a5857e13d8 Handle auto-completion line as argv, not a single argument
It's easier to detect a script name if passed as argv list.
Arguments can be parsed with quoted spaces (e.g. in directory path)
2017-01-24 14:40:31 +00:00
Daniil Fedotov 3871c4ccde Support autocompletion with different script names 2017-01-24 12:30:12 +00:00
Daniil Fedotov 6288d75472 Cleanup compiler warnings 2017-01-24 09:59:00 +00:00
Daniil Fedotov 2174446ff9 Auto complete command called with full path 2017-01-24 09:47:30 +00:00
Michael Klishin 6c4302d7f8 Revert "Fix --auto-complete clauses"
This reverts commit cbab77e34c.

See comments to cbab77e34c.
2017-01-23 13:28:31 +03:00
Arnaud Cogoluègnes 57f2eff218 Add read to topic permissions
Part of rabbitmq/rabbitmq-server#1085
2017-01-23 10:12:03 +01:00
Michael Klishin cbab77e34c Fix --auto-complete clauses
According to the completion script in rabbitmq/rabbitmq-server-release#14, the correct
way to invoke auto-completion is

    /path/to/rabbitmqctl --auto-complete [command prefix]

However, the above arguments were not matched by the existing
main heads.
2017-01-21 23:33:35 +03:00
Michael Klishin 6faff961c1 Fix a few compiler warnings 2017-01-21 23:18:58 +03:00
Michael Klishin ed68f0e957 Merge pull request #166 from rabbitmq/rabbitmq-event-exchange-10
Provide cli user as user who performs action for event notifications
2017-01-21 02:05:19 +03:00
Daniil Fedotov b7fb43fb48 Fix auto complete module to support new parser API 2017-01-18 15:38:33 +00:00
Michael Klishin ee34fac5bd Merge branch 'master' into rabbitmq-event-exchange-10 2017-01-17 20:28:03 +03:00
Daniil Fedotov bb57a213c0 List vhost limits command 2017-01-17 13:02:09 +00:00
Diana Corbacho fd6ba841cd Provide cli user as user who performs action for event notifications 2017-01-17 09:01:14 +00:00
Michael Klishin 5e15f5c2d2 Merge branch 'master' into rabbitmq-server-505 2017-01-12 12:58:27 +03:00
Jean-Sébastien Pédron 5905f1c40a Update copyright line to year 2017 2017-01-10 15:42:40 +01:00
Michael Klishin 6c5c35e4b1 Wording 2017-01-07 05:13:57 +08:00
Michael Klishin 088fa90faf Cosmetics 2017-01-07 04:54:31 +08:00
Diana Corbacho b2b804eda9 Limit number of connections to close 2017-01-06 15:15:31 +01:00
Diana Corbacho da8e333209 Test close all connections command 2017-01-06 13:54:48 +01:00
Diana Corbacho c4bf5ee0fa Close all connections command with vhost, global and delay options 2017-01-06 08:25:21 +01:00
Jean-Sébastien Pédron 530a9c7d83 {disable,enable}_command.ex: Support --all to enable/disable all plugins
[#136769947]
2016-12-29 11:47:48 +01:00
Jean-Sébastien Pédron 77a23a9a72 Move plugin_names() from list_command.ex to plugins_helpers.ex
[#136769947]
2016-12-29 11:46:17 +01:00
Arnaud Cogoluègnes 6160bdd57e Merge branch 'master' into rabbitmq-server-505 2016-12-27 16:43:57 +01:00
Michael Klishin 41a67e6c4f Actually, don't log anything
Those CT log entries would look really weird to the user
and we already log CLI failures in rabbitmq_ct_helpers.
2016-12-27 13:57:23 +03:00
Michael Klishin ce909f8d3a Explain; log something more meaningful with CT 2016-12-27 13:55:13 +03:00
Daniil Fedotov 30b41ba267 Support start from common_test tests 2016-12-23 12:12:33 +00:00
Arnaud Cogoluègnes 93e9d9301e Merge branch 'master' into rabbitmq-server-505 2016-12-22 17:50:18 +01:00
Daniil Fedotov 7d41df5d8d Fix sorting and plugin name access for plugin management commands 2016-12-22 16:19:17 +00:00
Arnaud Cogoluègnes c7a11fad38 Merge branch 'master' into rabbitmq-server-505 2016-12-22 17:09:06 +01:00
Arnaud Cogoluègnes 1dcc44d5f7 Add topic authorisation commands
References rabbitmq/rabbitmq-server#505
2016-12-22 16:50:59 +01:00
Diana Corbacho 7b689ae633 Detailed error message in memory threshold validation 2016-12-22 12:13:46 +01:00
Arnaud Cogoluègnes 93ca16c5ff Add global parameters commands
Part of rabbitmq/rabbitmq-mqtt#73
2016-12-16 16:41:29 +01:00
Gerhard Lazu 240c7c0862 Merge pull request #156 from rabbitmq/rabbitmq-cli-153
Load .ez plugins without version
2016-12-14 17:00:40 +00:00
Gerhard Lazu 4d46936749 Be more specific about what is being stopped on `stop_app`
rabbitmq/rabbitmq-server#1043
2016-12-14 12:04:54 +00:00
Michael Klishin eaaea172ae Squash a couple of compiler warnings 2016-12-14 14:55:03 +03:00
Michael Klishin c647314d79 Merge branch 'master' into rabbitmq-cli-153 2016-12-14 14:50:06 +03:00
Diana Corbacho 067f0cee14 Load .ez plugins without version 2016-12-13 13:06:16 +01:00
Michael Klishin ad094d74a9 Correct delegation here 2016-12-12 16:27:34 +03:00
Michael Klishin 1f7404ce4c Don't include double quotes in cookie hash output
It is easier to parse, in particular when -q is passed.
2016-12-12 15:51:29 +03:00
Diana Corbacho 6e29559910 Add tests for Erlang cookie hash command 2016-12-12 12:59:41 +01:00
Diana Corbacho 065c06dfab Erlang cookie hash command 2016-12-12 11:38:45 +01:00
Daniil Fedotov 8735851da4 Sort commands when printing help 2016-12-07 16:21:10 +00:00
Arnaud Cogoluègnes adef01fcbc Merge pull request #150 from rabbitmq/rabbitmq-cli-144
Introduce `rabbitmq-diagnostics maybe_stuck`
2016-12-07 16:10:22 +01:00
Michael Klishin 6f5d3c6bb0 Introduce `rabbitmq-diagnostics maybe_stuck`
Fixes #144.
[Finished ##135678977]
2016-12-07 17:10:17 +03:00
Daniil Fedotov f7a741ece8 Merge branch 'master' into rabbitmq-cli-134 2016-12-07 14:05:59 +00:00
Michael Klishin 216810d205 Drive by change: simplify 2016-12-07 15:47:28 +03:00
Michael Klishin 5a5e00a48e Use Erlang terms formatter to be compatible with eval 'ssl:cipher_suites().' output 2016-12-07 15:43:41 +03:00
Michael Klishin d6202f761c Make the Erlang term formatter concatenate stream elements with commas
Fixes #149, references #141.
2016-12-07 15:42:48 +03:00
Michael Klishin 7d730e739d Introduce `rabbitmq-diagnostics cipher_suites [--openssl-format]`
Fixes #141.
[##135616437]
2016-12-07 01:43:41 +03:00
Daniil Fedotov 967cc07c16 Do not streamify plain maps 2016-12-06 17:14:59 +00:00
Daniil Fedotov 6846cfa258 Remove useless output 2016-12-06 16:18:54 +00:00
Diana Corbacho 28d8259450 Real time output in enable/disable/set commands 2016-12-06 15:12:47 +00:00
Michael Klishin 7b809bd7a5 Wording 2016-12-06 17:00:50 +03:00
Daniil Fedotov fc0ca12a91 Test commands suggestions 2016-12-06 12:19:25 +00:00
Daniil Fedotov 80dc953ee5 Suggest commands by Levenshtein distance 2016-12-05 18:59:58 +00:00
Michael Klishin cb41fe932d Unbreak with_distribution/1 2016-12-05 19:23:20 +03:00
Michael Klishin 3deb0df90f Merge branch 'handle-distribution-errors' of https://github.com/binarin/rabbitmq-cli into binarin-handle-distribution-errors 2016-12-05 18:42:27 +03:00
Alexey Lebedeff 2d11e45625 Handle errors from distribution start attempts
Otherwise broken or misconfigured distribution is reported as an
unavailable broker node.
2016-12-05 17:51:22 +03:00
Michael Klishin 511a898a8f Wording 2016-12-05 17:39:38 +03:00
Michael Klishin e17c809530 Switch to a documented inet* function
References #137.
2016-12-05 17:38:16 +03:00
Alexey Lebedeff fcd23a6ca3 Fix longname-mode on hosts without detectable FQDN
Re-implement https://github.com/rabbitmq/rabbitmq-server/issues/890

CLI tools fail in longnames-mode if erlang is not able to determine host
FQDN (with at least one dot in it). E.g. this happens on docker.

And it was not possible to alleviate this situation using any options
from http://erlang.org/doc/apps/erts/inet_cfg.html
2016-12-05 16:06:52 +03:00
Michael Klishin ba0efb56b0 Merge pull request #133 from rabbitmq/rabbitmq-cli-129
Load command specific options from a single command
2016-12-03 11:32:44 +03:00
Michael Klishin f788060718 Extract function 2016-12-03 11:20:02 +03:00
Daniil Fedotov c62d48380a Load command specific options from a single command 2016-11-30 16:51:59 +00:00
Arnaud Cogoluègnes 409f8e3b00 Use 1 RPC call to get running plugins 2016-11-30 17:19:13 +01:00
Arnaud Cogoluègnes fd07c8b70b Support several versions of plugins in directories
References #131
2016-11-29 17:33:41 +01:00
Arnaud Cogoluègnes 304ab703f4 Support multiple plugins directories
References #131
2016-11-29 15:26:57 +01:00
Michael Klishin 95d7d055f2 Merge pull request #130 from rabbitmq/rabbitmq-cli-123
Make `rabbitmqctl stop` support an optional pid file argument
2016-11-23 21:19:15 +03:00
Michael Klishin 94c21f4a40 Make `rabbitmqctl stop` support an optional pid file argument
While at it, move test/helpers_test.exs under test/core.

This slightly changes command output (mentions what file path is used
or what its contents are when we cannot parse it). We try hard
to not introduce any breaking changes compared to the 3.6.x CLI
tools but in this case it's an improvement.
Also, no one should depend on `rabbitmqctl stop` output, only UNIX
exit code, which did not change.
2016-11-23 21:11:01 +03:00
Arnaud Cogoluègnes fcd7b66299 Add banner to encode command
Fixes #118
2016-11-23 10:18:20 +01:00
Arnaud Cogoluègnes fc08e50e88 Merge branch 'master' into rabbitmq-cli-118 2016-11-23 09:21:56 +01:00
Daniil Fedotov e3289ed454 Remove empty switches and aliases 2016-11-22 18:32:12 +00:00
Arnaud Cogoluègnes 887a09644b Merge branch 'master' into rabbitmq-cli-118 2016-11-22 16:51:27 +01:00
Michael Klishin 266a4f664e Make StopCommand#validate/2 accept a pidfile path 2016-11-22 17:23:19 +03:00
Michael Klishin c59b6c029f Make switches/0 and aliases/0 optional command callbacks
Fixes #120. Same as #124 but doesn't include any unrelated changes
and thus suffer from #126.
2016-11-22 16:11:25 +03:00
Michael Klishin e92022da11 Revert "Merge pull request #124 from rabbitmq/rabbitmq-cli-120"
This reverts commit c087a635c0, reversing
changes made to 59225a551d.

See https://github.com/rabbitmq/rabbitmq-cli/issues/126, which exposed
a serious flaw in the option parser split which was introduced
as part of #124.

Reopens #120.
2016-11-22 14:07:58 +03:00
Daniil Fedotov 5607b92e32 Remove empty switches/0 and aliases/0 callbacks 2016-11-21 11:26:40 +00:00
Daniil Fedotov cc87a49f93 Make switches as aliases callbacks optional 2016-11-18 17:21:27 +00:00
Daniil Fedotov 59225a551d Remove `flags/0` callback. Remove command modules helpers from helpers to command_modules 2016-11-18 14:12:53 +00:00
Arnaud Cogoluègnes 5e16943fe4 Add encode command
Catching up with rabbitmq/rabbitmq-server#979.

Fixes #118
2016-11-18 14:52:29 +01:00
Michael Klishin 0aa7bf6f9b Merge branch 'master' into rabbitmq-server-1030 2016-11-17 21:36:23 +03:00
Daniil Fedotov a664f83b9f Fix stream output for csv formatter 2016-11-17 16:09:18 +00:00
Daniil Fedotov e4ebdaabde Make rabbit node resolve from environment variable by default 2016-11-17 14:16:00 +00:00
Arnaud Cogoluègnes 061dc48e96 Use binaries for policy RPC call
Part of rabbitmq/rabbitmq-server#1030
2016-11-17 09:54:11 +01:00
Daniil Fedotov 77e17ddf13 Printer behaviour 2016-11-16 13:46:36 +00:00
Michael Klishin 0d61a2b0d0 Use Erlang term formatter by default for status
Fixes #106.
2016-11-16 00:15:44 +03:00
Michael Klishin 1cf7b70bc1 Merge pull request #116 from rabbitmq/rabbitmq-cli-115
CSV formatter
2016-11-15 22:05:48 +03:00
Daniil Fedotov 36ac65d56a Remove dependencies 2016-11-15 16:14:22 +00:00
Daniil Fedotov 82026a0ec8 More global switches to control environment 2016-11-15 16:14:10 +00:00
Daniil Fedotov f160f0536a New exec command to execute elixir code locally in command context. 2016-11-15 16:12:41 +00:00
Daniil Fedotov 4c05e343d7 Format CSV info items with helpers 2016-11-15 11:31:59 +00:00
Daniil Fedotov cb52a66d70 CSV formatter 2016-11-15 11:14:44 +00:00
Daniil Fedotov ccb6bf116c Namespace refactoring 2016-11-14 17:52:08 +00:00
Milton Mazzarri 6795aec784 Improve code consistency
* Fix some code consistency issues, mostly spaces around parenthesis, brackets and operators.
* Write large number with underscores (example: 70_000 instead of 70000)
* Write variable names in snake_case
* Remove trailing white spaces
2016-11-13 00:29:17 -06:00
Daniil Fedotov 31848069e2 Use RABBITMQ_NODENAME as default node 2016-11-11 11:12:09 +00:00
Daniil Fedotov 1dc8e90a70 Make tests happy 2016-11-10 17:40:43 +00:00
Daniil Fedotov 6c98c51a7d Call rabbit:alarms instead of rabbit:status to get alarms 2016-11-10 16:01:41 +00:00
Daniil Fedotov 3c8e6d1ef7 Use seconds in timeout parameter. Better timeout error report 2016-11-10 14:53:59 +00:00
Daniil Fedotov 63382a3b18 Force non infinity timeout for node health check. Node health check output 2016-11-10 13:51:01 +00:00
Daniil Fedotov 8f601a4bbe Erlang terms formatter name 2016-11-10 13:01:49 +00:00
Daniil Fedotov 7dd74a3232 Erlang terms formatter 2016-11-10 12:19:47 +00:00
Daniil Fedotov ca69dff530 Handle non-list format_output in table formatter 2016-11-10 12:12:17 +00:00
Daniil Fedotov 58af1261b1 Flatten list_consumers output in table formatter 2016-11-09 18:18:32 +00:00
Daniil Fedotov 0d88314c50 It's not a map, it's a keyword list 2016-11-09 17:11:51 +00:00
Daniil Fedotov b984a423bf Support --local argument in list_queues 2016-11-09 17:02:05 +00:00
Daniil Fedotov b436f52797 Proper error handling 2016-11-09 17:02:05 +00:00
Daniil Fedotov dae427bbf9 Handle non-error outputs in wait command 2016-11-09 13:03:35 +00:00
Daniil Fedotov 9ebf876c9a Do not require ENABLED_PLUGINS_FILE to run ctl, still print an error 2016-11-08 14:45:59 +00:00
Daniil Fedotov 4d0f9b1fb5 Load commands from plugins 2016-11-08 14:25:14 +00:00
Daniil Fedotov b0f59ead31 Fix tests 2016-11-08 14:23:09 +00:00
Daniil Fedotov ad90e60121 script name is overridable via argument 2016-11-08 14:21:31 +00:00
Daniil Fedotov 60fdcecdb4 Format disabled plugins 2016-11-08 14:19:11 +00:00
Daniil Fedotov 3e3d8f3f0b Fix tests for plugins commands 2016-11-08 14:19:11 +00:00
Daniil Fedotov b8c7360b14 Plugins enable/disable command formatter 2016-11-08 14:19:11 +00:00
Daniil Fedotov b98470288d List plugins formatter 2016-11-08 14:19:11 +00:00
Daniil Fedotov 4733765759 Better generic formatting. No tests for format_error 2016-11-08 10:11:07 +00:00
Michael Klishin db194fb013 Merge branch 'master' into rabbitmq-cli-105
Conflicts:
	test/forget_cluster_node_command_test.exs
	test/rename_cluster_node_command_test.exs
2016-11-07 22:37:24 +03:00
Daniil Fedotov 837226430b Coordinate environment with config module 2016-11-07 22:03:09 +03:00
Michael Klishin e423453159 Add a missing clause 2016-11-07 09:45:43 -08:00
Daniil Fedotov 08e263ab2a Vhost limits commands 2016-11-07 14:08:26 +00:00
Daniil Fedotov 85d6868763 Make table formatter look like in the old CLI 2016-11-04 12:38:35 +00:00
Daniil Fedotov 603dfd4cf0 Add optional callbacks to the command behaviour 2016-11-04 11:29:14 +00:00
Daniil Fedotov aaabab1fe9 Enable table formatter for each list_ command 2016-11-04 11:17:02 +00:00
Daniil Fedotov dcd831ec99 Correct IO device name 2016-11-04 11:12:14 +00:00
Daniil Fedotov 14d82eabdc Refactor error reporting to allow commands specify formatter 2016-11-04 11:11:03 +00:00
Daniil Fedotov 3f4abba717 Command specific formatters 2016-11-03 18:10:18 +00:00
Daniil Fedotov cb3e54d8d8 Table formatter 2016-10-31 18:07:24 +00:00
Michael Klishin 74cb3a2b53 diag, diagnostic => diagnostics 2016-10-12 01:07:40 +03:00
Daniil Fedotov 70b867e908 Naming 2016-10-07 14:57:10 +01:00
Daniil Fedotov 41f38e29f8 Make read-only commands part of the rabbitmq-diag tool 2016-10-07 14:36:54 +01:00
Michael Klishin e1de90218c Merge pull request #104 from rabbitmq/rabbitmq-cli-101
Operator policies commands
2016-09-08 15:35:56 +04:00
Daniil Fedotov 599cede1df Convert error_string char list to string 2016-09-08 11:03:08 +01:00
Daniil Fedotov 3ac39162be Operator policies commands 2016-09-08 11:02:21 +01:00
Daniil Fedotov fe3e83ec50 Fixing some tests 2016-09-07 12:46:47 +01:00
Michael Klishin 4a277f1fdd A bit of docs 2016-09-05 13:29:11 +03:00
Michael Klishin 64ee6dfaf2 Wording 2016-09-05 13:06:45 +03:00
Michael Klishin b65d8649cd Cosmetics 2016-09-05 12:47:59 +03:00
Michael Klishin 59a57a8d37 Merge branch 'master' into rabbitmq-cli-90 2016-09-05 12:44:18 +03:00
Daniil Fedotov a7fe88e74c Example json formatter. Remove IO.puts from commands 2016-08-23 14:28:07 +01:00
Daniil Fedotov 57550182e1 Specific output tests 2016-08-22 15:05:17 +01:00
Daniil Fedotov 6d2208063f Write to file using file printer 2016-08-22 14:19:15 +01:00
Daniil Fedotov c88eb090f3 File printer 2016-08-22 14:13:38 +01:00
Daniil Fedotov 4c13a51ac8 Reworking command outputs 2016-08-22 12:58:37 +01:00
Daniil Fedotov 616476cc66 Remove duplicate require_rabbit function 2016-08-18 17:55:29 +01:00
Daniil Fedotov 0da30bd1d1 Help command return list of strings instead of printing them\ 2016-08-18 17:38:49 +01:00
Daniil Fedotov 35fc3d12cd Default output formatting and exit code selection. Inspect printer 2016-08-18 15:35:49 +01:00
Michael Klishin b154b998ca Make sure rabbit_event is functional
It will be required as of server#500.
2016-08-18 12:09:27 +03:00
Daniil Fedotov 4b25f8ab18 Add rabbit plugins to path when requiring rabbit to be loaded 2016-08-17 17:06:15 +01:00
Andrew Bruce 19f0ba94d3 Inline default_opts
[#127359637]
2016-08-15 15:09:12 +01:00
Andrew Bruce 541ad4249c Fix merge_defaults implementations
...and don't default inside run methods.

Defaults must go on left-hand-side of `Map.merge`, or they'll clobber
user-defined settings.

Remove some unnecessary pattern matching.

Issue #92

[#127359637]
2016-08-15 14:21:15 +01:00
Michael Klishin 4e45a52dd4 Fix an IO.puts/1 line ported from io:format/2 too literally 2016-08-14 08:37:32 +03:00
Michael Klishin 49e9cb2909 pong and pang are atoms 2016-08-14 08:16:44 +03:00
Michael Klishin 1d911b4350 Delete a duplicate fn head 2016-08-14 08:07:19 +03:00
Michael Klishin b57e8e16cc Don't rely on rabbit_control_main; coerce node names to atoms
`rabbit_control_main` is going away due to the very existence of
these new CLI tools.
2016-08-12 04:46:26 +03:00
Michael Klishin cb209d834d Merge branch 'master' into rabbitmq-cli-rename-cluster-node-command
Conflicts:
	lib/rabbitmqctl.ex
2016-08-12 04:36:51 +03:00
Michael Klishin 508a906bf9 Wording, add aliases to UpdateClusterNodesCommand 2016-08-12 02:34:43 +03:00
Michael Klishin 17773fcd1f Merge branch 'master' into rabbitmq-cli-update-cluster-nodes 2016-08-12 01:56:12 +03:00
Michael Klishin 0e8ab49937 Brush up tests, support both "disc" and "disk"
as the current `rabbitmqctl` does.
2016-08-12 01:54:23 +03:00
Michael Klishin 0449004a6b Merge branch 'master' into rabbitmq-cli-change-cluster-node-type 2016-08-12 01:04:01 +03:00
Michael Klishin 81ea222428 Fix CLI arguments parsing for policies, brush up tests
Policy commands now work on the CLI against an actual node.
2016-08-11 17:15:43 +03:00
Michael Klishin e9ef2cff34 Merge branch 'master' into rabbitmq-cli-policies-commands 2016-08-11 13:58:11 +03:00
Michael Klishin ad2b4627c7 Merge branch 'master' into rabbitmq-cli-9
Conflicts:
	lib/rabbitmq/cli/ctl/parser.ex
	lib/rabbitmqctl.ex
2016-08-11 11:52:54 +03:00
Michael Klishin ef2c06f0f4 Merge branch 'master' into rabbitmq-cli-force-boot-command 2016-08-11 11:12:59 +03:00
Michael Klishin 29c3bf3f43 Wording, cosmetics 2016-08-11 10:56:32 +03:00
Michael Klishin cb03611e2a Merge branch 'master' into rabbitmq-cli-78 2016-08-11 10:49:39 +03:00
Michael Klishin 7525ee3373 Cosmetics 2016-08-11 09:52:37 +03:00
Michael Klishin 76fb17d8f2 Use MapSet.difference/2 here, too 2016-08-11 09:37:48 +03:00
Michael Klishin 30e0c66127 Use sets in more places; rabbit_plugins:ensure/1 expects an Erlang list
Both CLI and tests now generally work as expected.
2016-08-11 01:44:27 +03:00
Michael Klishin 05db449187 Handle duplicates on plugin lists, be more defensive with defaults
Makes CLI invocations of `rabbitmq-plugins {enable, disable, list}`
mostly work.
2016-08-11 01:27:13 +03:00
Daniil Fedotov 6f3f0854bd Rename auto complete option for consistency 2016-08-10 18:19:06 +01:00
Michael Klishin 31c3356c56 Use effective program name in help command output
Note that this solution is imperfect because
for tests the name of the tool is `mix`. But most
tests don't care.
2016-08-09 15:05:48 +03:00
Michael Klishin bec4e6f4f9 Drop rabbitmq-plugins active_plugins
`rabbitmq-plugins list` with flags can do the same thing.

Per discussion with @hairyhum.
2016-08-09 13:46:20 +03:00
Michael Klishin eef1c36024 Drop _plugins from plugin management module names 2016-08-09 00:03:58 +03:00
Michael Klishin a06a4321d6 merge_defaults_defaults => merge_all_defaults 2016-08-08 21:46:47 +03:00
Daniil Fedotov ca98b02656 Implement policy management commands 2016-07-29 14:59:19 +01:00
Daniil Fedotov 4d40649d44 Command auto completion 2016-07-28 17:46:37 +01:00
Daniil Fedotov a0c5af375b Implement forget_cluster_node command 2016-07-27 14:41:02 +01:00
Daniil Fedotov e89bf53357 Do not require rabbit as dependency 2016-07-27 12:27:27 +01:00
Daniil Fedotov 7b35c7c2cc More validation, error handling and tests 2016-07-27 11:48:24 +01:00
Daniil Fedotov f2c4986fcf Implementing rename_cluster_nodes command 2016-07-26 18:08:37 +01:00
Daniil Fedotov cd68b3ce9c Implement change_cluster_node_type command 2016-07-25 16:48:45 +01:00
Daniil Fedotov 12cbd50f10 Implement update_cluster_nodes command 2016-07-25 15:11:05 +01:00
Daniil Fedotov 0eee8e2446 Implement force_boot command 2016-07-25 14:01:41 +01:00
Daniil Fedotov 57c4a0fa69 Fix some tests 2016-07-25 14:00:55 +01:00
Daniil Fedotov a84cd93d2e Implement eval command 2016-07-22 17:17:15 +01:00
Michael Klishin 58708b6ac3 Merge branch 'master' into rabbitmq-cli-83 2016-07-15 23:54:48 +03:00
Michael Klishin 909a3b41fe Adapt to recent server rabbit_health_check changes 2016-07-15 23:47:15 +03:00
Michael Klishin 786ec7672d Rename 2016-07-10 21:36:12 +03:00
Michael Klishin 09fc873a34 Improve a couple of error atoms 2016-07-10 19:47:27 +03:00
Michael Klishin 70f486c27d Squash a few compilation warnings 2016-07-10 12:08:33 +03:00
Michael Klishin 941263e83c Eliminate several warnings 2016-06-26 22:47:37 +03:00
Daniil Fedotov 5b828c7e64 Tests for command modules 2016-06-23 12:33:39 +01:00
Daniil Fedotov 5c5f4d4414 Plugins command tests 2016-06-23 10:50:01 +01:00
Daniil Fedotov eda1e7cac2 Tests for list plugins command 2016-06-23 10:50:01 +01:00
Daniil Fedotov 963f6a2ff9 tests for list plugins command 2016-06-23 10:50:01 +01:00
Daniil Fedotov 2415ee58aa Plugin management commands 2016-06-23 10:50:01 +01:00
Daniil Fedotov 75d8632d87 Aliases in behaviour. List plugins command 2016-06-23 10:50:01 +01:00
Daniil Fedotov 33caaecb9b Select command scope by namespace 2016-06-23 10:50:01 +01:00
Daniil Fedotov 0d026a5f4a Example plugins command 2016-06-23 10:50:01 +01:00
Daniil Fedotov deb6e99b49 Removed scopes from command behaviour 2016-06-23 10:50:01 +01:00
Daniil Fedotov 9baa5c1ebe Load commands from load path. Specify scope in application config by file name 2016-06-23 10:50:01 +01:00
Daniil Fedotov 1f3bc3e6d7 Use scopes and separate Mix projects to generate escripts 2016-06-23 10:50:01 +01:00
Michael Klishin 78ae2585a3 Inline 2016-06-15 00:22:42 +03:00
Michael Klishin bc5ff3bf26 Merge pull request #79 from rabbitmq/rabbitmq-cli-69
Purge queue command
2016-06-14 23:07:55 +03:00
Michael Klishin 2d68d42241 Assert that messages were purged; don't assume 0 messages were deleted 2016-06-14 23:04:27 +03:00
Michael Klishin d77eb83c5f A few Helpers.parse_node calls are no longer necessary
[Finish ##121221959]
2016-06-14 14:21:16 +03:00
Andrew Bruce ec3a191515 Purge queue command
This initial version makes two RPC calls:

1. Gets the amqqueue resource
2. Makes the purge request using that resource

Issue #69
2016-06-14 10:31:47 +01:00
Michael Klishin 39b3de4d1e Namespace commands, fixes #74
Note that the top level module is not namespaced. It's
not clear to me if it should be or will be end up using
and (Elixir/Mix) umbrella project anyway.
2016-06-10 02:54:22 +03:00
Michael Klishin 506c9cc43f Normalize node names before passing them to Command.run/2
Fixes #76.
2016-06-10 00:56:44 +03:00
Andrew Bruce 0c94b3d87a Fix typo in node name 2016-06-09 15:49:57 +01:00
Michael Klishin c7af6e7398 Normalize node name 2016-06-09 15:30:01 +03:00
Michael Klishin e95a085b3e Merge branch 'master' into rabbitmq-cli-70 2016-06-09 15:19:46 +03:00
Michael Klishin fe2eb2d31b Normalize node names in sync_queue and cancel_sync_queue 2016-06-09 15:19:29 +03:00
Andrew Bruce 7730539bc1 set_cluster_name
- Shows up in help
- Validates args a bit
- Has no defaults

Issue #70

[#116551629]
2016-06-09 11:29:27 +01:00
Michael Klishin d59e0fa444 Merge branch 'master' into rabbitmq-cli-67 2016-06-09 04:13:48 +03:00
Michael Klishin d27469c665 RabbitMQ.CLI.RabbitMQCtl => RabbitMQ.CLI.Ctl, references #74 2016-06-09 04:08:21 +03:00
Michael Klishin 4e31f4c627 More renaming, references #74 2016-06-09 04:00:43 +03:00
Michael Klishin 509179402a Missing file for the previous commit 2016-06-09 03:35:11 +03:00
Michael Klishin 8fcad8338e Namespace more modules under RabbitMQ.CLI, part of #74 2016-06-09 03:34:56 +03:00
Michael Klishin 89a3cd954c Merge branch 'master' into rabbitmq-cli-67 2016-06-09 02:23:53 +03:00
Michael Klishin 0c35f5a8cd Move start_distribution into RabbitMQ.CLI.Distribution 2016-06-09 02:23:10 +03:00
Michael Klishin 3a2b277d4f Squash a warning 2016-06-09 00:42:51 +03:00
Daniil Fedotov 091105e5b0 0 arity start_distribution 2016-06-08 17:04:08 +01:00
Daniil Fedotov 9b703b2896 Dynamically select distribution node 2016-06-08 15:19:37 +01:00
Michael Klishin d834e8007b Merge branch 'master' into rabbitmq-cli-67 2016-06-08 16:53:02 +03:00
Michael Klishin 2de1460e65 Missing license header 2016-06-08 03:34:49 +03:00
Michael Klishin 34961e7fed Implement sync_queue and cancel_sync_queue commands
Happy path tests need a multi-node testing framework.
2016-06-08 03:32:41 +03:00
Michael Klishin 9d2af8c352 Introduce RabbitCommon.Records
While I ended up not using this, this allows for easier manipulation
of amqqueue records from IEx:

``` elixir
require RabbitCommon.Records
Keyword.get(RabbitCommon.Records.amqqueue(amq_queue_record), :pid)
```

It also demonstrates how records can be organized in this (supposedly) multi-tool
repository.
2016-06-08 03:08:06 +03:00
Michael Klishin 204e982a94 Make usage/0 return a string 2016-06-08 01:48:49 +03:00
Michael Klishin e41cba0cb5 Clarify what 'target node' is 2016-06-07 01:19:21 +03:00
Jean-Sébastien Pédron 1b1534f86b Implement the `join_cluster` command
Compared to the Erlang-based rabbitmqctl's command, this one accepts
`--disc` to specify the node type. In the implementation, it does
nothing because that's the default value already. It is only to improve
consistency, because there is a `--ram` flag.

The testsuite for this command is incomplete in this commit. When a
testcase will be able to start and stop multiple nodes, the testsuite
will need to be completed.

[#116551629]
2016-06-06 16:06:52 +02:00
Jean-Sébastien Pédron 9349c9bf07 Improve "Please stop the node with rabbitmqctl stop_app" message
... with "Please stop RabbitMQ with rabbitmqctl stop_app".

The previous message didn't make sense: `stop_app` only stop the
RabbitMQ application, not the entire node (which we don't want to do in
the context of this message).
2016-06-06 16:00:50 +02:00
kjnilsson e5c35c2939 merge 2016-06-02 16:09:56 +01:00
kjnilsson 43ae69a06d Implement wait command 2016-06-02 16:03:54 +01:00
Michael Klishin 8c6d1a80ce Merge branch 'master' into rabbitmq-cli-61 2016-06-02 17:03:03 +03:00
Michael Klishin 771e0193fe Squash a warning 2016-06-02 17:01:59 +03:00
kjnilsson 17fff860c8 Implement rotate_logs command 2016-06-02 13:01:12 +01:00
kjnilsson 65efddef2f Implement stop command 2016-06-02 12:48:41 +01:00
Michael Klishin ebb0dd579b Cosmetics 2016-06-02 14:16:15 +03:00
kjnilsson dec08906fa Implement reset and force_reset commands 2016-06-02 11:55:10 +01:00
Michael Klishin be84eb1e96 Handle node healthcheck failures 2016-06-02 01:38:09 +03:00
Michael Klishin d6d68af950 Merge branch 'master' into rabbitmq-cli-51 2016-06-01 23:42:56 +03:00
Michael Klishin 04395c44b2 Merge branch 'master' into rabbitmq-cli-55 2016-06-01 22:47:04 +03:00
kjnilsson 884ef6a11b Implement start_app and stop_app commands 2016-06-01 20:12:35 +01:00
Michael Klishin 0e028c3526 Merge branch 'master' into rabbitmq-cli-52 2016-06-01 18:18:07 +03:00
kjnilsson 5bd17fe241 Implement the close_connection command 2016-06-01 16:05:55 +01:00
Michael Klishin 27d4d89acb Brush up change_password tests 2016-06-01 17:04:32 +03:00
Michael Klishin fc5c7f287e Brush up authenticate_user tests, fix AuthenticateUserCommand#banner 2016-06-01 17:01:30 +03:00
Michael Klishin cd63268b9a Fix banner of the add_user command 2016-06-01 16:52:22 +03:00
Michael Klishin f69f601386 Implement the node_health_check command 2016-06-01 16:44:12 +03:00
kjnilsson 60bbca6ead fix list_bindings banner function clause error 2016-06-01 08:40:57 +01:00
kjnilsson 715f691b8e avoid connecting to rabbitmq before executing help command
avoid printing a nil banner
2016-05-31 09:40:48 +01:00
Michael Klishin 1261a2c20f This fn should to be public now 2016-05-30 02:17:13 +03:00
Michael Klishin c8f36766b2 Don't fail with undef when printing command usage info with invalid CLI arguments 2016-05-30 02:16:10 +03:00
Michael Klishin 17f6c10f6b Cosmetics 2016-05-30 02:06:52 +03:00
Daniil Fedotov 70c17aa4f0 Print full usage on errors 2016-05-27 08:59:14 -06:00
Daniil Fedotov e01e0da063 Print help for selected command 2016-05-27 08:59:14 -06:00
kjnilsson d8ed6bef3c merge 2016-05-27 12:10:11 +01:00
kjnilsson 0704c14376 update status command with new behaviour 2016-05-27 11:25:21 +01:00
Michael Klishin aab8281fef Cosmetics 2016-05-27 11:46:52 +03:00
Daniil Fedotov a01c6436a0 Basic check for options overlap 2016-05-26 16:50:06 -06:00
Daniil Fedotov d83a59637d Ability to specify switches in commands 2016-05-26 15:02:10 -06:00
Michael Klishin a879c2a185 Cosmetics 2016-05-26 01:52:21 +03:00
Michael Klishin ace351daa3 Cosmetics 2016-05-26 01:51:45 +03:00
Michael Klishin fb060e0cc5 Wording 2016-05-26 01:51:31 +03:00
Michael Klishin 092647b63a Clean up 2016-05-26 01:50:49 +03:00
Daniil Fedotov d2a1367168 Cleanup 2016-05-25 23:13:37 +01:00
Daniil Fedotov bf7872cbb4 unused erg 2016-05-25 22:40:39 +01:00
Daniil Fedotov ed79aae726 Listing items in parallel 2016-05-25 22:34:15 +01:00
Daniil Fedotov cfe41481a3 Return Stream from listing commands 2016-05-25 20:03:17 +01:00
kjnilsson cea02c562c Initial implementations of cluster_status and report command 2016-05-24 10:00:40 +01:00
Michael Klishin 6264d69eb8 Merge branch 'stable' into rabbitmq-cli-31 2016-05-23 16:29:11 +03:00
Michael Klishin 8774cc7cc3 Cosmetics 2016-05-23 16:23:44 +03:00
Michael Klishin 3fc388ac90 Merge pull request #34 from rabbitmq/rabbitmq-cli-33
add mem_relative usage option to set_disk_free_limit
2016-05-23 14:07:19 +03:00
kjnilsson ec5fec1561 add mem_relative usage option to set_disk_free_limit 2016-05-23 10:53:55 +01:00
Daniil Fedotov a0cba28cdd Rename param to vhost 2016-05-23 10:23:07 +01:00
Daniil Fedotov aad7e41af2 Parameter list and clear commands 2016-05-23 10:23:07 +01:00
Daniil Fedotov ec5b8b3317 Rename param to vhost in broker display commands 2016-05-21 18:57:39 +01:00
Michael Klishin 8725945520 Cosmetics 2016-05-21 17:42:03 +03:00
Michael Klishin c5915b75f6 Squash a warning 2016-05-21 17:33:59 +03:00
Michael Klishin f4e9d04751 Merge branch 'stable' into rabbitmq-cli-29 2016-05-21 17:33:51 +03:00
Daniil Fedotov 52a5488025 Made all timeout errors return timeout in seconds 2016-05-20 18:16:35 +01:00
Michael Klishin ac19b90e66 Squash a couple of warnings 2016-05-20 17:46:36 +03:00
Daniil Fedotov ca8762b729 Renamed "param" to "vhost" 2016-05-19 17:28:27 +01:00
Daniil Fedotov 46b5279a14 Mention consumerinfoitems in usage 2016-05-19 14:26:40 +01:00
Daniil Fedotov 52a9aa2c96 More broker display tests 2016-05-19 14:26:40 +01:00
Daniil Fedotov 670e7bbe47 RpcStream tests 2016-05-19 14:26:40 +01:00
Daniil Fedotov b1b90b7131 wip. testing queues command 2016-05-19 14:26:40 +01:00
Daniil Fedotov 1abf9622f2 list_* commands 2016-05-19 14:26:40 +01:00
Daniil Fedotov ee12c4d526 Linee break in command specific usage 2016-05-10 09:58:54 +01:00
Daniil Fedotov b7b2bbdcd2 Merge pull request #26 from rabbitmq/rabbitmq-cli-25
Re-parse the command on bad option in standard messages
2016-05-10 09:29:50 +01:00
Brandon Shroyer 3fa54b1666 Merge pull request #20 from rabbitmq/experimental
Refactorings
2016-05-09 18:52:58 -04:00
Brandon Shroyer fe6f9763fd Parse commands internally in some print_standard_message commands 2016-05-09 11:38:37 -04:00
Brandon Shroyer 675b53040a Re-parse the command on bad option in standard messages 2016-05-09 11:07:49 -04:00
Brandon Shroyer 76a228feec Fix clear_permissions default option merge so it doesn't suppress quiet flag 2016-05-09 10:21:39 -04:00
Daniil Fedotov a4033ef769 Print usage on incorrect command behaviour 2016-05-09 11:07:46 +01:00
Daniil Fedotov 3f869e18fb Fixing tests 2016-05-05 18:17:50 +01:00
Daniil Fedotov ed28bef62e Some refactorings 2016-05-05 11:39:27 +01:00
Daniil Fedotov 357904e0fe Experimental 2016-05-05 11:22:42 +01:00
Brandon Shroyer 1269397f03 Add run to command behaviour 2016-05-04 19:21:21 -04:00
Brandon Shroyer a158a1b2a8 Refactor module command execution in main module 2016-05-04 19:21:21 -04:00
Brandon Shroyer a2bedded17 WIP: Change module-specific command name to to run/2 2016-05-04 19:21:21 -04:00
Brandon Shroyer 72c15cd8f2 Squash unused variable warning in list_users 2016-05-04 17:11:43 -04:00
Brandon Shroyer 90019eaf41 Add CommandBehaviour behavior to all command modules 2016-05-04 17:10:47 -04:00
Brandon Shroyer 819aa082b7 Create command behaviour 2016-05-04 17:07:54 -04:00
Brandon Shroyer 40552dab87 Merge unaliased options into parser output (so they can trigger a validation failure later) 2016-05-04 16:21:18 -04:00
Brandon Shroyer ca07bee46f Add check for valid flags to main module 2016-05-04 15:40:09 -04:00
Brandon Shroyer 3cdfdb31c4 Add short flags/0 function to all modules 2016-05-04 15:37:35 -04:00
Brandon Shroyer f533448239 Add suppressable info message to authenticate_user command 2016-05-03 13:37:34 -04:00
Brandon Shroyer 3bd83784d2 Add suppressable info message to change_password_command 2016-05-03 13:32:08 -04:00
Brandon Shroyer fa97614b01 Add suppressable info message to clear_password command 2016-05-03 12:24:00 -04:00
Brandon Shroyer e699284682 Add suppressable info message to clear_permissions command 2016-05-03 12:19:03 -04:00
Brandon Shroyer 98958bc4f3 Add suppressable info message to add_user command 2016-05-03 11:56:03 -04:00
Brandon Shroyer 6b86324f62 Add suppressable info message to delete_user command 2016-05-03 11:50:06 -04:00
Brandon Shroyer ad56b57d0d Add suppressable info message to add_vhost command 2016-05-03 11:08:12 -04:00
Brandon Shroyer ab52576aea Add suppressable info message to delete_vhost command 2016-05-03 11:00:41 -04:00
Brandon Shroyer 266bd15779 Add suppressable info messages to list_permissions command 2016-05-03 10:51:28 -04:00
Brandon Shroyer b6010b4af5 Add suppressable info message to list_user_permissions 2016-05-03 10:28:40 -04:00
Brandon Shroyer 7836306f55 Add suppressable info message to list_users command 2016-05-03 10:26:00 -04:00
Brandon Shroyer 49d961c2b3 Add suppressable info message to list_vhosts command 2016-05-03 09:54:54 -04:00
Brandon Shroyer 503dda6ef2 Add suppressable info message to environment command 2016-05-02 18:01:30 -04:00
Brandon Shroyer 7bc042ff89 Add suppressable info to set_parameter command 2016-05-02 17:53:18 -04:00
Brandon Shroyer b516dd273c Add suppressable info to set_permissions command 2016-05-02 17:37:27 -04:00