Commit Graph

42 Commits

Author SHA1 Message Date
Michael Klishin 968eefa1bb
Bump (c) line year
There are no functional changes to this massive diff.
2025-01-01 17:54:10 -05:00
Michael Klishin 1b642353ca
Update (c) according to [1]
1. https://investors.broadcom.com/news-releases/news-release-details/broadcom-and-vmware-intend-close-transaction-november-22-2023
2023-11-21 23:18:22 -05:00
Rin Kuryloski bdb2046185
Add rabbitmq_cli dialyze to bazel (#7066)
* Add rabbitmq_cli dialyze to bazel

and fix a number of warnings

Because we stop mix from recompiling rabbit_common in bazel, many
unknown functions are reported, so this dialyzer analysis is somewhat
incomplete.

* Use erlang dialyzer for rabbitmq_cli rather than mix dialyzer

Since this resolves all of the rabbit functions, there are far fewer
unknown functions.

Requires yet to be released rules_erlang 3.9.2

* Temporarily use pre-release rules_erlang

So that checks can run on this PR without a release

* Fix additional dialyzer warnings in rabbitmq_cli

* rabbitmq_cli: mix format

* Additional fixes for ignored return values

* Revert "Temporarily use pre-release rules_erlang"

This reverts commit c16b5b6815.

* Use rules_erlang 3.9.2
2023-01-31 15:05:52 +01:00
Rin Kuryloski 08d641a1a9 Fix dialyzer warnings revealed from previous commit 2023-01-19 17:29:29 +01:00
Michael Klishin ec4f1dba7d
(c) year bump: 2022 => 2023 2023-01-01 23:17:36 -05:00
Ayanda Dube 4cbbaad2df mix format rabbitmq_cli 2022-10-02 18:54:11 +01:00
Michael Klishin c38a3d697d
Bump (c) year 2022-03-21 01:21:56 +04:00
Michael Klishin 17526987c6
Bump (c) year 2021-02-14 00:54:01 +03:00
dcorbacho 679ca254f3 Switch to Mozilla Public License 2.0 (MPL 2.0) 2020-07-11 19:23:07 +01:00
Jean-Sébastien Pédron 0e15591bf5 Update copyright (year 2020) 2020-03-10 15:39:56 +01:00
Michael Klishin 73776fbf04 (c) bump 2019-12-29 05:50:26 +03:00
Daniil Fedotov 25b441ae53 Make it possible to specify a custom printer for commands. Add std_io_raw printer.
Log streaming should print data as received without adding new lines.
To do that std_io_printer just writes all output to the std_io.
2019-06-26 17:34:35 -04:00
Michael Klishin f2b80a4116 A way for commands to provide a list of relevant doc guides
in the help message.
2019-03-26 15:51:06 +03:00
Michael Klishin fe0bb70420 Compile 2019-03-26 14:20:17 +03:00
Michael Klishin 3dc526c528 usage_additional/0 can return a list of pairs 2019-03-26 14:14:00 +03:00
Spring Operator 0a2541afd3 URL Cleanup
This commit updates URLs to prefer the https protocol. Redirects are not followed to avoid accidentally expanding intentionally shortened URLs (i.e. if using a URL shortener).

# HTTP URLs that Could Not Be Fixed
These URLs were unable to be fixed. Please review them to see if they can be manually resolved.

* http://blog.listincomprehension.com/search/label/procket (200) with 1 occurrences could not be migrated:
   ([https](https://blog.listincomprehension.com/search/label/procket) result ClosedChannelException).
* http://dozzie.jarowit.net/trac/wiki/TOML (200) with 1 occurrences could not be migrated:
   ([https](https://dozzie.jarowit.net/trac/wiki/TOML) result SSLHandshakeException).
* http://dozzie.jarowit.net/trac/wiki/subproc (200) with 1 occurrences could not be migrated:
   ([https](https://dozzie.jarowit.net/trac/wiki/subproc) result SSLHandshakeException).
* http://e2project.org (200) with 1 occurrences could not be migrated:
   ([https](https://e2project.org) result AnnotatedConnectException).
* http://erlang.org/doc/reference_manual/distributed.html (200) with 1 occurrences could not be migrated:
   ([https](https://erlang.org/doc/reference_manual/distributed.html) result ConnectTimeoutException).
* http://nitrogenproject.com/ (200) with 2 occurrences could not be migrated:
   ([https](https://nitrogenproject.com/) result ConnectTimeoutException).
* http://proper.softlab.ntua.gr (200) with 1 occurrences could not be migrated:
   ([https](https://proper.softlab.ntua.gr) result SSLHandshakeException).
* http://yaws.hyber.org (200) with 1 occurrences could not be migrated:
   ([https](https://yaws.hyber.org) result AnnotatedConnectException).
* http://choven.ca (503) with 1 occurrences could not be migrated:
   ([https](https://choven.ca) result ConnectTimeoutException).

# Fixed URLs

## Fixed But Review Recommended
These URLs were fixed, but the https status was not OK. However, the https status was the same as the http request or http redirected to an https URL, so they were migrated. Your review is recommended.

* http://fixprotocol.org/ (301) with 1 occurrences migrated to:
  https://fixtrading.org ([https](https://fixprotocol.org/) result SSLHandshakeException).
* http://erldb.org (UnknownHostException) with 1 occurrences migrated to:
  https://erldb.org ([https](https://erldb.org) result UnknownHostException).
* http://elixir-lang.org/docs/stable/elixir/OptionParser.html (301) with 1 occurrences migrated to:
  https://elixir-lang.org/docs/stable/elixir/OptionParser.html ([https](https://elixir-lang.org/docs/stable/elixir/OptionParser.html) result 404).
* http://elixir-lang.org/docs/stable/elixir/Stream.html (301) with 1 occurrences migrated to:
  https://elixir-lang.org/docs/stable/elixir/Stream.html ([https](https://elixir-lang.org/docs/stable/elixir/Stream.html) result 404).

## Fixed Success
These URLs were switched to an https URL with a 2xx status. While the status was successful, your review is still recommended.

* http://cloudi.org/ with 27 occurrences migrated to:
  https://cloudi.org/ ([https](https://cloudi.org/) result 200).
* http://elixir-lang.org with 1 occurrences migrated to:
  https://elixir-lang.org ([https](https://elixir-lang.org) result 200).
* http://elixir-lang.org/ with 2 occurrences migrated to:
  https://elixir-lang.org/ ([https](https://elixir-lang.org/) result 200).
* http://elixir-lang.org/getting-started/typespecs-and-behaviours.html with 1 occurrences migrated to:
  https://elixir-lang.org/getting-started/typespecs-and-behaviours.html ([https](https://elixir-lang.org/getting-started/typespecs-and-behaviours.html) result 200).
* http://elixir-lang.org/install.html with 1 occurrences migrated to:
  https://elixir-lang.org/install.html ([https](https://elixir-lang.org/install.html) result 200).
* http://erlware.org/ with 1 occurrences migrated to:
  https://erlware.org/ ([https](https://erlware.org/) result 200).
* http://inaka.github.io/cowboy-trails/ with 1 occurrences migrated to:
  https://inaka.github.io/cowboy-trails/ ([https](https://inaka.github.io/cowboy-trails/) result 200).
* http://ninenines.eu with 6 occurrences migrated to:
  https://ninenines.eu ([https](https://ninenines.eu) result 200).
* http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html with 1 occurrences migrated to:
  https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html ([https](https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html) result 200).
* http://www.actordb.com/ with 2 occurrences migrated to:
  https://www.actordb.com/ ([https](https://www.actordb.com/) result 200).
* http://www.cs.kent.ac.uk/projects/wrangler/Home.html with 1 occurrences migrated to:
  https://www.cs.kent.ac.uk/projects/wrangler/Home.html ([https](https://www.cs.kent.ac.uk/projects/wrangler/Home.html) result 200).
* http://www.rebar3.org with 1 occurrences migrated to:
  https://www.rebar3.org ([https](https://www.rebar3.org) result 200).
* http://contributor-covenant.org with 1 occurrences migrated to:
  https://contributor-covenant.org ([https](https://contributor-covenant.org) result 301).
* http://contributor-covenant.org/version/1/3/0/ with 1 occurrences migrated to:
  https://contributor-covenant.org/version/1/3/0/ ([https](https://contributor-covenant.org/version/1/3/0/) result 301).
* http://inaka.github.com/apns4erl with 1 occurrences migrated to:
  https://inaka.github.com/apns4erl ([https](https://inaka.github.com/apns4erl) result 301).
* http://inaka.github.com/edis/ with 1 occurrences migrated to:
  https://inaka.github.com/edis/ ([https](https://inaka.github.com/edis/) result 301).
* http://lasp-lang.org/ with 1 occurrences migrated to:
  https://lasp-lang.org/ ([https](https://lasp-lang.org/) result 301).
* http://rabbitmq.com/documentation.html with 1 occurrences migrated to:
  https://rabbitmq.com/documentation.html ([https](https://rabbitmq.com/documentation.html) result 301).
* http://saleyn.github.com/erlexec with 1 occurrences migrated to:
  https://saleyn.github.com/erlexec ([https](https://saleyn.github.com/erlexec) result 301).
* http://www.mozilla.org/MPL/ with 290 occurrences migrated to:
  https://www.mozilla.org/MPL/ ([https](https://www.mozilla.org/MPL/) result 301).
* http://zhongwencool.github.io/observer_cli with 1 occurrences migrated to:
  https://zhongwencool.github.io/observer_cli ([https](https://zhongwencool.github.io/observer_cli) result 301).
2019-03-20 03:13:07 -05:00
Daniil Fedotov 8bae6cd929 Add behaviour helpers.
Instead of calling function_exported? every time to access behaviour
functions, call CommandBehaviour.function.

Isolate all function defaults in the CommandBehaviour module.

Add a macro to define constant command functions.
2019-02-11 14:03:19 -05:00
Daniil Fedotov d6789e60f2 A new way to display basic usage.
Do not show additional parameters info.
List commands as names and descriptions.
Group commands in sections.

New behaviour callbacks:
help_section/0 - atom name of a group to put command to. Default is :other
description/0 - single line description of the command. Printed in the commands list

Sections ans descriptions are WIP.
2019-02-08 15:33:17 -05:00
Michael Klishin 94b55d71fa Format with `gmake format` 2019-01-30 22:20:29 +03:00
Michael Klishin b6f4d75afc Update (c) year 2019-01-20 06:10:59 +03:00
Daniil Fedotov b5de2236ce 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.
2017-12-06 18:10:11 +00: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
Michael Klishin ea1078fc5f Update command type specs 2017-08-11 18:06:16 +03:00
Michael Klishin 586a557096 Add a type spec for validate_execution_environment/2 2017-08-11 14:15:36 +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 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 b8d6042046 Quiet mode for wait command will suppress log messages 2017-06-07 14:22:59 +01:00
Jean-Sébastien Pédron 5905f1c40a Update copyright line to year 2017 2017-01-10 15:42:40 +01: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 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
Daniil Fedotov 603dfd4cf0 Add optional callbacks to the command behaviour 2016-11-04 11:29:14 +00:00
Daniil Fedotov 14d82eabdc Refactor error reporting to allow commands specify formatter 2016-11-04 11:11:03 +00:00
Michael Klishin 4a277f1fdd A bit of docs 2016-09-05 13:29:11 +03:00
Daniil Fedotov 35fc3d12cd Default output formatting and exit code selection. Inspect printer 2016-08-18 15:35:49 +01:00
Daniil Fedotov 75d8632d87 Aliases in behaviour. List 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
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