From 9fb81989267b01a954108c4b9528e52a595aa199 Mon Sep 17 00:00:00 2001 From: Tristan Sloughter Date: Thu, 10 Sep 2015 16:41:48 -0500 Subject: update completions and docs for command unstable install and upgrade --- README.md | 1 + priv/shell-completion/bash/rebar3 | 3 +++ priv/shell-completion/fish/rebar3.fish | 25 +++++++++++++++---------- priv/shell-completion/zsh/_rebar3 | 16 +++++++++++----- src/rebar_prv_local_install.erl | 2 +- src/rebar_prv_local_upgrade.erl | 2 +- 6 files changed, 32 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 8d85934..39b6b72 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,7 @@ locations ([hex.pm](http://hex.pm), git, hg, and so on). | tar | Package release into tarball | | tree | Print dependency tree | | unlock | Unlock dependencies | +| unstable | Namespace providing commands that are still in flux | | update | Update package index | | upgrade | Fetch latest version of dep | | version | Print current version of Erlang/OTP and rebar | diff --git a/priv/shell-completion/bash/rebar3 b/priv/shell-completion/bash/rebar3 index 511d537..30d74dd 100644 --- a/priv/shell-completion/bash/rebar3 +++ b/priv/shell-completion/bash/rebar3 @@ -33,6 +33,7 @@ _rebar3() tar \ tree \ unlock \ + unstable \ update \ upgrade \ version \ @@ -187,6 +188,8 @@ _rebar3() elif [[ ${prev} == tree ]] ; then sopts="-v" lopts="--verbose" + elif [[ ${prev} == unstable ]] ; then + : elif [[ ${prev} == update ]] ; then : elif [[ ${prev} == upgrade ]] ; then diff --git a/priv/shell-completion/fish/rebar3.fish b/priv/shell-completion/fish/rebar3.fish index f3b449e..31d38b7 100644 --- a/priv/shell-completion/fish/rebar3.fish +++ b/priv/shell-completion/fish/rebar3.fish @@ -53,6 +53,7 @@ end ## tar Tar archive of release built of project. ## tree Print dependency tree. ## unlock Unlock dependencies. +## unstable Namespace providing commands that are still in flux. ## update Update package index. ## upgrade Upgrade dependencies. ## version Print version for rebar and current Erlang. @@ -101,7 +102,7 @@ complete -f -c 'rebar3' -n '__fish_rebar3_using_command dialyzer' -s u -l update complete -f -c 'rebar3' -n '__fish_rebar3_using_command dialyzer' -s s -l succ-typings -d "Enable success typing analysis. Default: true" complete -f -c 'rebar3' -n '__fish_rebar3_needs_command' -a do -d "Higher order provider for running multiple tasks in a sequence." -complete -f -c 'rebar3' -n '__fish_rebar3_using_command do' -a 'compile, clean, ct, cover, deps, dialyzer, edoc, eunit, help, new, pkgs, release, relup, report, shell, tar, unlock, update, upgrade, version, xref,' +complete -f -c 'rebar3' -n '__fish_rebar3_using_command do' -a 'compile, clean, ct, cover, deps, dialyzer, edoc, eunit, help, new, pkgs, release, relup, report, shell, tar, unlock, unstable, update, upgrade, version, xref,' ## TODO: do should understand plugins, but now it does not. complete -f -c 'rebar3' -n '__fish_rebar3_needs_command' -a edoc -d "Generate documentation using edoc." @@ -121,14 +122,14 @@ complete -f -c 'rebar3' -n '__fish_rebar3_using_command new' -a help -d "Display complete -f -c 'rebar3' -n '__fish_rebar3_needs_command' -a paths -d "Print paths to build dirs in current profile." complete -f -c 'rebar3' -n '__fish_rebar3_needs_command paths' -l app -d "Comma seperated list of applications to return paths for." -complete -f -c 'rebar3' -n '__fish_rebar3_needs_command paths' -l base -d "Return the `base' path of the current profile." -complete -f -c 'rebar3' -n '__fish_rebar3_needs_command paths' -l bin -d Return the `bin' path of the current profile." -complete -f -c 'rebar3' -n '__fish_rebar3_needs_command paths' -l ebin -d "Return all `ebin' paths of the current profile's applications." -complete -f -c 'rebar3' -n '__fish_rebar3_needs_command paths' -l lib -d "Return the `lib' path of the current profile." -complete -f -c 'rebar3' -n '__fish_rebar3_needs_command paths' -l priv -d "Return the `priv' path of the current profile's applications." +complete -f -c 'rebar3' -n '__fish_rebar3_needs_command paths' -l base -d "Return the `base` path of the current profile." +complete -f -c 'rebar3' -n '__fish_rebar3_needs_command paths' -l bin -d "Return the `bin` path of the current profile." +complete -f -c 'rebar3' -n '__fish_rebar3_needs_command paths' -l ebin -d "Return all `ebin` paths of the current profile`s applications." +complete -f -c 'rebar3' -n '__fish_rebar3_needs_command paths' -l lib -d "Return the `lib` path of the current profile." +complete -f -c 'rebar3' -n '__fish_rebar3_needs_command paths' -l priv -d "Return the `priv` path of the current profile`s applications." complete -f -c 'rebar3' -n '__fish_rebar3_needs_command paths' -s s -l separator -d "In case of multiple return paths, the separator character to use to join them." -complete -f -c 'rebar3' -n '__fish_rebar3_needs_command paths' -l src -d "Return the `src' path of the current profile's applications." -complete -f -c 'rebar3' -n '__fish_rebar3_needs_command paths' -l rel -d "Return the `rel' path of the current profile." +complete -f -c 'rebar3' -n '__fish_rebar3_needs_command paths' -l src -d "Return the `src` path of the current profile`s applications." +complete -f -c 'rebar3' -n '__fish_rebar3_needs_command paths' -l rel -d "Return the `rel` path of the current profile." complete -f -c 'rebar3' -n '__fish_rebar3_needs_command' -a pkgs -d "List available packages." complete -f -c 'rebar3' -n '__fish_rebar3_needs_command' -a release -d "Build release of project." @@ -137,8 +138,8 @@ complete -f -c 'rebar3' -n '__fish_rebar3_needs_command' -a report -d "Provide a complete -f -c 'rebar3' -n '__fish_rebar3_needs_command' -a shell -d "Run shell with project apps and deps in path." complete -f -c 'rebar3' -n '__fish_rebar3_using_command shell' -l config -d "Allows to load a config file, if any. Defaults to the sys_config entry defined for relx if present." -complete -f -c 'rebar3' -n '__fish_rebar3_using_command shell' -l name -d "equivalent to erlang's -name" -complete -f -c 'rebar3' -n '__fish_rebar3_using_command shell' -l sname -d "equivalent to erlang's -sname" +complete -f -c 'rebar3' -n '__fish_rebar3_using_command shell' -l name -d "equivalent to erlang`s -name" +complete -f -c 'rebar3' -n '__fish_rebar3_using_command shell' -l sname -d "equivalent to erlang`s -sname" complete -f -c 'rebar3' -n '__fish_rebar3_needs_command' -a tar -d "Tar archive of release built of project." complete -f -c 'rebar3' -n '__fish_rebar3_using_command tar' -s n -l relname -d "Specify the name for the release that will be generated" @@ -168,6 +169,10 @@ complete -f -c 'rebar3' -n '__fish_rebar3_needs_command tree' -s v -l verbose - complete -f -c 'rebar3' -n '__fish_rebar3_needs_command' -a unlock -d "Unlock dependencies." +complete -f -c 'rebar3' -n '__fish_rebar3_needs_command' -a unstable -d "Namespace providing commands that are still in flux." + +complete -f -c 'rebar3' -n '__fish_rebar3_using_command unstable' -a 'install upgrade' + complete -f -c 'rebar3' -n '__fish_rebar3_needs_command' -a update -d "Update package index." complete -f -c 'rebar3' -n '__fish_rebar3_needs_command' -a upgrade -d "Upgrade dependencies." diff --git a/priv/shell-completion/zsh/_rebar3 b/priv/shell-completion/zsh/_rebar3 index 8855bdf..c04791b 100644 --- a/priv/shell-completion/zsh/_rebar3 +++ b/priv/shell-completion/zsh/_rebar3 @@ -111,11 +111,11 @@ _rebar3 () { (path) _arguments \ '(--app)--app[Comma seperated list of applications to return paths for.]:apps' \ - '(--base)--base[Return the `base' path of the current profile.]' \ - '(--bin)--bin[Return the `bin' path of the current profile.]' \ - '(--ebin)--ebin[Return all `ebin' paths of the current profile's applications.]' \ - '(--lib)--lib[Return the `lib' path of the current profile.]' \ - '(--priv)--priv[Return the `priv' path of the current profile's applications.]' \ + '(--base)--base[Return the `base` path of the current profile.]' \ + '(--bin)--bin[Return the `bin` path of the current profile.]' \ + '(--ebin)--ebin[Return all `ebin` paths of the current profile`s applications.]' \ + '(--lib)--lib[Return the `lib` path of the current profile.]' \ + '(--priv)--priv[Return the `priv` path of the current profile`s applications.]' \ '(-s --separator)--separator[In case of multiple return paths, the separator character to use to join them.]' \ && ret=0 ;; @@ -212,6 +212,11 @@ _rebar3 () { '*: :_rebar3_list_deps' \ && ret=0 ;; + (unstable) + _arguments \ + '*: :(install upgrade)' \ + && ret=0 + ;; (update) _message 'rebar update' && ret=0 ;; @@ -254,6 +259,7 @@ _rebar3_tasks() { 'tar:Tar archive of release built of project.' 'tree:Print dependency tree.' 'unlock:Unlock dependencies.' + 'unstable:Namespace providing commands that are still in flux.' 'update:Update package index.' 'upgrade:Upgrade dependencies.' 'version:Print version for rebar and current Erlang.' diff --git a/src/rebar_prv_local_install.erl b/src/rebar_prv_local_install.erl index 6d83fc3..4422c2d 100644 --- a/src/rebar_prv_local_install.erl +++ b/src/rebar_prv_local_install.erl @@ -31,7 +31,7 @@ init(State) -> {bare, true}, {namespace, ?NAMESPACE}, {deps, ?DEPS}, - {example, "rebar3 local install"}, + {example, "rebar3 unstable install"}, {short_desc, "Extract libs from rebar3 escript along with a run script."}, {desc, ""}, {opts, []}])), diff --git a/src/rebar_prv_local_upgrade.erl b/src/rebar_prv_local_upgrade.erl index 831436e..9431524 100644 --- a/src/rebar_prv_local_upgrade.erl +++ b/src/rebar_prv_local_upgrade.erl @@ -29,7 +29,7 @@ init(State) -> {bare, true}, {namespace, ?NAMESPACE}, {deps, ?DEPS}, - {example, "rebar3 local upgrade"}, + {example, "rebar3 unstable upgrade"}, {short_desc, "Download latest rebar3 escript and extract."}, {desc, ""}, {opts, []}])), -- cgit v1.1