aboutsummaryrefslogtreecommitdiffstats
path: root/priv
diff options
context:
space:
mode:
authorLuis Rascao <[email protected]>2016-10-30 00:45:54 +0100
committerLuis Rascao <[email protected]>2016-10-30 16:16:08 +0000
commit3894abe211c803fa1a50840a92824e92aa31497e (patch)
tree85f9dceba898d1124d0400c25d5a1e5a8807f07e /priv
parent7e8ea5a9a059c9e42ec2c71f382552622f01cfbc (diff)
downloadrelx-3894abe211c803fa1a50840a92824e92aa31497e.tar.gz
relx-3894abe211c803fa1a50840a92824e92aa31497e.tar.bz2
relx-3894abe211c803fa1a50840a92824e92aa31497e.zip
Provide per-command command line help
Diffstat (limited to 'priv')
-rwxr-xr-xpriv/templates/extended_bin62
1 files changed, 61 insertions, 1 deletions
diff --git a/priv/templates/extended_bin b/priv/templates/extended_bin
index 0881a08..63a46d1 100755
--- a/priv/templates/extended_bin
+++ b/priv/templates/extended_bin
@@ -31,6 +31,57 @@ REL_DIR="$RELEASE_ROOT_DIR/releases/$REL_VSN"
ERL_OPTS="{{ erl_opts }}"
RUNNER_LOG_DIR="${RUNNER_LOG_DIR:-$RELEASE_ROOT_DIR/log}"
+relx_usage() {
+ command="$1"
+
+ case "$command" in
+ unpack)
+ echo "Usage: $REL_NAME unpack [VERSION]"
+ echo "Unpacks a release package VERSION, it assumes that this"
+ echo "release package tarball has already been deployed at one"
+ echo "of the following locations:"
+ echo " releases/<relname>-<version>.tar.gz"
+ echo " releases/<version>/<relname>-<version>.tar.gz"
+ echo " releases/<version>/<relname>.tar.gz"
+ ;;
+ install)
+ echo "Usage: $REL_NAME install [VERSION]"
+ echo "Installs a release package VERSION, it assumes that this"
+ echo "release package tarball has already been deployed at one"
+ echo "of the following locations:"
+ echo " releases/<relname>-<version>.tar.gz"
+ echo " releases/<version>/<relname>-<version>.tar.gz"
+ echo " releases/<version>/<relname>.tar.gz"
+ ;;
+ uninstall)
+ echo "Usage: $REL_NAME uninstall [VERSION]"
+ echo "Uninstalls a release VERSION, it will only accept"
+ echo "versions that are not currently in use"
+ ;;
+ upgrade)
+ echo "Usage: $REL_NAME upgrade [VERSION]"
+ echo "Upgrades the currently running release to VERSION, it assumes"
+ echo "that a release package tarball has already been deployed at one"
+ echo "of the following locations:"
+ echo " releases/<relname>-<version>.tar.gz"
+ echo " releases/<version>/<relname>-<version>.tar.gz"
+ echo " releases/<version>/<relname>.tar.gz"
+ ;;
+ downgrade)
+ echo "Usage: $REL_NAME downgrade [VERSION]"
+ echo "Downgrade the currently running release to VERSION, it assumes"
+ echo "that a release package tarball has already been deployed at one"
+ echo "of the following locations:"
+ echo " releases/<relname>-<version>.tar.gz"
+ echo " releases/<version>/<relname>-<version>.tar.gz"
+ echo " releases/<version>/<relname>.tar.gz"
+ ;;
+ *)
+ echo "Usage: $REL_NAME {start|start_boot <file>|foreground|stop|restart|reboot|pid|ping|console|console_clean|console_boot <file>|attach|remote_console|upgrade|downgrade|install|uninstall|versions|escript|rpc|rpcterms|eval}"
+ ;;
+ esac
+}
+
find_erts_dir() {
__erts_dir="$RELEASE_ROOT_DIR/erts-$ERTS_VSN"
if [ -d "$__erts_dir" ]; then
@@ -460,8 +511,17 @@ case "$1" in
shift
relx_nodetool "eval" $@
;;
+ help)
+ if [ -z "$2" ]; then
+ relx_usage
+ exit 1
+ fi
+
+ TOPIC="$2"; shift
+ relx_usage $TOPIC
+ ;;
*)
- echo "Usage: $REL_NAME {start|start_boot <file>|foreground|stop|restart|reboot|pid|ping|console|console_clean|console_boot <file>|attach|remote_console|upgrade|downgrade|install|uninstall|versions|escript|rpc|rpcterms|eval}"
+ relx_usage
exit 1
;;
esac