summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandru Scvortov <alexandru@rabbitmq.com>2011-09-14 13:17:39 +0100
committerAlexandru Scvortov <alexandru@rabbitmq.com>2011-09-14 13:17:39 +0100
commit61218503e5e193b1048a180f9060ee4f05511af5 (patch)
treed3bc6828d32fd36673b196a268ad3460febe8acb
parent446982936be9adc2102c63187ba987403e05879d (diff)
downloadrabbitmq-server-git-61218503e5e193b1048a180f9060ee4f05511af5.tar.gz
add rabbitmq-plugin manpage
-rw-r--r--Makefile4
-rw-r--r--docs/rabbitmq-plugin.1.xml156
-rw-r--r--src/rabbit_plugin.erl2
3 files changed, 159 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 2ef1bf027e..3fecc735f1 100644
--- a/Makefile
+++ b/Makefile
@@ -18,7 +18,7 @@ TARGETS=$(EBIN_DIR)/rabbit.app $(INCLUDE_DIR)/rabbit_framing.hrl $(BEAM_TARGETS)
WEB_URL=http://www.rabbitmq.com/
MANPAGES=$(patsubst %.xml, %.gz, $(wildcard $(DOCS_DIR)/*.[0-9].xml))
WEB_MANPAGES=$(patsubst %.xml, %.man.xml, $(wildcard $(DOCS_DIR)/*.[0-9].xml) $(DOCS_DIR)/rabbitmq-service.xml)
-USAGES_XML=$(DOCS_DIR)/rabbitmqctl.1.xml
+USAGES_XML=$(DOCS_DIR)/rabbitmqctl.1.xml $(DOCS_DIR)/rabbitmq-plugin.1.xml
USAGES_ERL=$(foreach XML, $(USAGES_XML), $(call usage_xml_to_erl, $(XML)))
QC_MODULES := rabbit_backing_queue_qc
QC_TRIALS ?= 100
@@ -296,7 +296,7 @@ install_bin: all install_dirs
cp -r ebin include LICENSE LICENSE-MPL-RabbitMQ INSTALL $(TARGET_DIR)
chmod 0755 scripts/*
- for script in rabbitmq-env rabbitmq-server rabbitmqctl; do \
+ for script in rabbitmq-env rabbitmq-server rabbitmqctl rabbitmq-plugin; do \
cp scripts/$$script $(TARGET_DIR)/sbin; \
[ -e $(SBIN_DIR)/$$script ] || ln -s $(SCRIPTS_REL_PATH)/$$script $(SBIN_DIR)/$$script; \
done
diff --git a/docs/rabbitmq-plugin.1.xml b/docs/rabbitmq-plugin.1.xml
new file mode 100644
index 0000000000..493485b9c6
--- /dev/null
+++ b/docs/rabbitmq-plugin.1.xml
@@ -0,0 +1,156 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.docbook.org/xml/4.5/docbookx.dtd">
+<!--
+ There is some extra magic in this document besides the usual DocBook semantics
+ to allow us to derive manpages, HTML and usage messages from the same source
+ document.
+
+ Examples need to be moved to the end for man pages. To this end, <para>s and
+ <screen>s with role="example" will be moved, and with role="example-prefix"
+ will be removed.
+
+ The usage messages are more involved. We have some magic in usage.xsl to pull
+ out the command synopsis, global option and subcommand synopses. We also pull
+ out <para>s with role="usage".
+
+ Finally we construct lists of possible values for subcommand options, if the
+ subcommand's <varlistentry> has role="usage-has-option-list". The option which
+ takes the values should be marked with role="usage-option-list".
+-->
+
+<refentry lang="en">
+ <refentryinfo>
+ <productname>RabbitMQ Server</productname>
+ <authorgroup>
+ <corpauthor>The RabbitMQ Team &lt;<ulink url="mailto:info@rabbitmq.com"><email>info@rabbitmq.com</email></ulink>&gt;</corpauthor>
+ </authorgroup>
+ </refentryinfo>
+
+ <refmeta>
+ <refentrytitle>rabbitmq-plugin</refentrytitle>
+ <manvolnum>1</manvolnum>
+ <refmiscinfo class="manual">RabbitMQ Service</refmiscinfo>
+ </refmeta>
+
+ <refnamediv>
+ <refname>rabbitmq-plugin</refname>
+ <refpurpose>command line tool for managing a RabbitMQ broker plugins</refpurpose>
+ </refnamediv>
+
+ <refsynopsisdiv>
+ <cmdsynopsis>
+ <command>rabbitmq-plugin</command>
+ <arg choice="req"><replaceable>command</replaceable></arg>
+ <arg choice="opt" rep="repeat"><replaceable>command options</replaceable></arg>
+ </cmdsynopsis>
+ </refsynopsisdiv>
+
+ <refsect1>
+ <title>Description</title>
+ <para>
+ <command>rabbitmq-plugin</command> is a command line tool for
+ managing a RabbitMQ broker plugins. It allows you to easily
+ enable, disable and browse plugins. Note that it must be run by
+ a user with write permissions to the RabbitMQ installation
+ directory.
+ </para>
+ </refsect1>
+
+ <refsect1>
+ <title>Commands</title>
+
+ <refsect2>
+ <title>Local Plugin Management</title>
+
+ <variablelist>
+ <varlistentry>
+ <term><cmdsynopsis><command>list</command> <arg choice="opt">-c</arg> <arg choice="opt"><replaceable>pattern</replaceable></arg></cmdsynopsis></term>
+ <listitem>
+ <variablelist>
+ <varlistentry>
+ <term>-c</term>
+ <listitem><para>List plugins compactly.</para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>pattern</term>
+ <listitem><para>Pattern to filter the plugin names by.</para></listitem>
+ </varlistentry>
+ </variablelist>
+ <para>
+ Lists available plugins, their versions, dependencies
+ and descriptions.
+ </para>
+ <para>
+ If the optional pattern is given, only plugins whose
+ name mathes pattern are shown.
+ </para>
+ <para role="example-prefix">For example:</para>
+ <screen role="example">rabbitmq-plugin list</screen>
+ <para role="example">
+ This command lists all the plugins available..
+ </para>
+ <screen role="example">rabbitmq-plugin list -c</screen>
+ <para role="example">
+ This command lists all the plugins available, on one line each.
+ </para>
+ <screen role="example">rabbitmq-plugin list -c management</screen>
+ <para role="example">
+ This command lists all the plugins available, on one
+ line each, but does not display plugins whose name does
+ not contain "management".
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><cmdsynopsis><command>enable</command> <arg choice="req"><replaceable>plugin</replaceable> ...</arg></cmdsynopsis></term>
+ <listitem>
+ <variablelist>
+ <varlistentry>
+ <term>plugin</term>
+ <listitem><para>One or more plugins to enable.</para></listitem>
+ </varlistentry>
+ </variablelist>
+ <para>
+ Enables the specified plugins and all their
+ dependencies.
+ </para>
+
+ <para role="example-prefix">For example:</para>
+ <screen role="example">rabbitmq-plugin enable rabbitmq_shovel rabbitmq_management</screen>
+ <para role="example">
+ This command enables the <command>shovel</command> and
+ <command>management</command> plugins and all their
+ dependencies.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><cmdsynopsis><command>disable</command> <arg choice="req"><replaceable>plugin</replaceable> ...</arg></cmdsynopsis></term>
+ <listitem>
+ <variablelist>
+ <varlistentry>
+ <term>plugin</term>
+ <listitem><para>One or more plugins to disable.</para></listitem>
+ </varlistentry>
+ </variablelist>
+ <para>
+ Disables the specified plugins and all plugins that
+ depend on them.
+ </para>
+
+ <para role="example-prefix">For example:</para>
+ <screen role="example">rabbitmq-plugin disable amqp_client</screen>
+ <para role="example">
+ This command disables the <command>amqp_client</command>
+ and all other plugins that depend on it.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect2>
+
+ </refsect1>
+
+</refentry>
diff --git a/src/rabbit_plugin.erl b/src/rabbit_plugin.erl
index 1088cee684..4cf2a35ea3 100644
--- a/src/rabbit_plugin.erl
+++ b/src/rabbit_plugin.erl
@@ -71,7 +71,7 @@ print_error(Format, Args) ->
rabbit_misc:format_stderr("Error: " ++ Format ++ "~n", Args).
usage() ->
- io:format("Insert USAGE here.~n"),
+ io:format("~s", [rabbit_plugin_usage:usage()]),
rabbit_misc:quit(1).
%%----------------------------------------------------------------------------