From cf66dfd6ba65bc6f2926ce3b6b67f195a3faa715 Mon Sep 17 00:00:00 2001 From: alisdair sullivan Date: Sun, 1 Nov 2015 18:49:41 -0800 Subject: adjust shell completions to match available command line options --- priv/shell-completion/bash/rebar3 | 23 +++++++++-------------- priv/shell-completion/fish/rebar3.fish | 22 ++++++++++++++++++++-- priv/shell-completion/zsh/_rebar3 | 24 +++++++++--------------- 3 files changed, 38 insertions(+), 31 deletions(-) (limited to 'priv') diff --git a/priv/shell-completion/bash/rebar3 b/priv/shell-completion/bash/rebar3 index 87ee9eb..771297c 100644 --- a/priv/shell-completion/bash/rebar3 +++ b/priv/shell-completion/bash/rebar3 @@ -54,11 +54,7 @@ _rebar3() --suite \ --group \ --case \ - --spec \ - --join_specs \ - --label \ --config \ - --userconfig \ --allow_user_terms \ --logdir \ --logopts \ @@ -66,21 +62,20 @@ _rebar3() --silent_connections \ --stylesheet \ --cover \ - --cover_spec \ - --cover_stop \ - --event_handler \ - --include \ - --abort_if_missing_suites \ - --multiply_timetraps \ - --scale_timetraps \ - --create_priv_dir \ --repeat \ --duration \ --until \ --force_stop \ --basic_html \ - --ct_hooks \ - --verbose" + --stylesheet \ + --decrypt_key \ + --decrypt_file \ + --abort_if_missing_suites \ + --multiply_timetraps \ + --scale_timetraps \ + --create_priv_dir \ + --verbose" \ + --auto_compile elif [[ ${prev} == deps ]] ; then : elif [[ ${prev} == dialyzer ]] ; then diff --git a/priv/shell-completion/fish/rebar3.fish b/priv/shell-completion/fish/rebar3.fish index 0d5d302..7b63e20 100644 --- a/priv/shell-completion/fish/rebar3.fish +++ b/priv/shell-completion/fish/rebar3.fish @@ -90,10 +90,28 @@ complete -f -c 'rebar3' -n '__fish_rebar3_needs_command' -a ct -d "Run Common Te complete -f -c 'rebar3' -n '__fish_rebar3_using_command ct' -l dir -d "Compile and run all test suites in the specified directories." complete -f -c 'rebar3' -n '__fish_rebar3_using_command ct' -l suites -d "Compile and run all test suites specified. Must be specified by full path, either absolute or relative to the current directory." complete -f -c 'rebar3' -n '__fish_rebar3_using_command ct' -l group -d "Test groups to run." +complete -f -c 'rebar3' -n '__fish_rebar3_using_command ct' -l label -d "Test label." complete -f -c 'rebar3' -n '__fish_rebar3_using_command ct' -l config -d "Config files to use when running tests." +complete -f -c 'rebar3' -n '__fish_rebar3_using_command ct' -l allow_user_terms -d "Allow user defined terms in config files." complete -f -c 'rebar3' -n '__fish_rebar3_using_command ct' -l logdir -d "The directory in which test logs will be written. Default: _build/test/logs" -complete -f -c 'rebar3' -n '__fish_rebar3_using_command ct' -s v -l verbose -d "Enable verbose output. Default: false" -complete -f -c 'rebar3' -n '__fish_rebar3_using_command ct' -s c -l cover -d "Generate cover data" +complete -f -c 'rebar3' -n '__fish_rebar3_using_command ct' -l logopts -d "Options for common test logging." +complete -f -c 'rebar3' -n '__fish_rebar3_using_command ct' -l verbosity -d "Verbosity." +complete -f -c 'rebar3' -n '__fish_rebar3_using_command ct' -s c -l cover -d "Generate cover data." +complete -f -c 'rebar3' -n '__fish_rebar3_using_command ct' -l include -d "Include folders." +complete -f -c 'rebar3' -n '__fish_rebar3_using_command ct' -l repeat -d "How often to repeat tests." +complete -f -c 'rebar3' -n '__fish_rebar3_using_command ct' -l duration -d "Max runtime (format: HHMMSS)." +complete -f -c 'rebar3' -n '__fish_rebar3_using_command ct' -l until -d "Run until (format: HHMMSS)." +complete -f -c 'rebar3' -n '__fish_rebar3_using_command ct' -l force_stop -d "Force stop on test timeout." +complete -f -c 'rebar3' -n '__fish_rebar3_using_command ct' -l basic_html -d "Show basic HTML." +complete -f -c 'rebar3' -n '__fish_rebar3_using_command ct' -l stylesheet -d "CSS stylesheet to apply to html output." +complete -f -c 'rebar3' -n '__fish_rebar3_using_command ct' -l decrypt_key -d "Path to key for decrypting config." +complete -f -c 'rebar3' -n '__fish_rebar3_using_command ct' -l decrypt_file -d "Path to file containing key for decrypting config." +complete -f -c 'rebar3' -n '__fish_rebar3_using_command ct' -l abort_if_missing_suites -d "Abort if suites are missing." +complete -f -c 'rebar3' -n '__fish_rebar3_using_command ct' -l multiply_timetraps -d "Multiply timetraps." +complete -f -c 'rebar3' -n '__fish_rebar3_using_command ct' -l scale_timetraps -d "Scale timetraps." +complete -f -c 'rebar3' -n '__fish_rebar3_using_command ct' -l create_priv_dir -d "Create priv dir (auto_per_run | auto_per_tc | manual_per_tc)." +complete -f -c 'rebar3' -n '__fish_rebar3_using_command ct' -s v -l verbose -d "Enable verbose output. Default: false." +complete -f -c 'rebar3' -n '__fish_rebar3_using_command ct' -l auto_compile -d "Let common test compile test suites instead of rebar3." complete -f -c 'rebar3' -n '__fish_rebar3_needs_command' -a deps -d "List dependencies" diff --git a/priv/shell-completion/zsh/_rebar3 b/priv/shell-completion/zsh/_rebar3 index d4e1c35..f0fb351 100644 --- a/priv/shell-completion/zsh/_rebar3 +++ b/priv/shell-completion/zsh/_rebar3 @@ -43,33 +43,27 @@ _rebar3 () { '(--suite)--suite[List of test suites to run]:suites' \ '(--group)--group[List of test groups to run]:groups' \ '(--case)--case[List of test cases to run]:cases' \ - '(--spec)--spec[List of test specs to run]:specs' \ - '(--join_specs)--join_specs' \ '(--label)--label[Test label]:label' \ '(--config)--config[List of config files]:config files:_files' \ - '(--userconfig)--userconfig' \ '(--allow_user_terms)--allow_user_terms' \ '(--logdir)--logdir[Log folder]:log folder:_files -/' \ '(--logopts)--logopts' \ '(--verbosity)--verbosity[Verbosity]:verbosity' \ - '(--silent_connections)--silent_connections' \ - '(--stylesheet)--stylesheet[Stylesheet to use for test results]:stylesheet:_files' \ '(-c --cover)'{-c,--cover}'[Generate cover data]' \ - '(--cover_spec)--cover_spec[Cover file to use]:cover file:_files' \ - '(--cover_stop)--cover_stop' \ - '(--event_handler)--event_handler[Event handlers to attach to the runner]:event handlers' \ - '(--include)--include[Include folder]:include directory:_files -/' \ - '(--abort_if_missing_suites)--abort_if_missing_suites[Abort if suites are missing]:abort missing suites:(true false)' \ - '(--multiply_timetraps)--multiply_timetraps' \ - '(--scale_timetraps)--scale_timetraps' \ - '(--create_priv_dir)--create_priv_dir' \ '(--repeat)--repeat[How often to repeat tests]:repeat test count' \ '(--duration)--duration[Max runtime (format: HHMMSS)]:max run time' \ '(--until)--until[Run until (format: HHMMSS)]:run until time' \ - '(--force_stop)--force_stop[Force stop after time]' \ + '(--force_stop)--force_stop[Force stop on test timeout]:skip_rest' \ '(--basic_html)--basic_html[Show basic HTML]' \ - '(--ct_hooks)--ct_hooks:ct hooks' \ + '(--stylesheet)--stylesheet[Stylesheet to use for test results]:stylesheet:_files' \ + '(--decrypt_key)--decrypt_key[Path to key for decrypting config]:decrypt key:_files' \ + '(--decrypt_file)--decrypt_file[Path to file containing key for decrypting config]:decrypt file:_files' \ + '(--abort_if_missing_suites)--abort_if_missing_suites[Abort if suites are missing]:abort missing suites:(true false)' \ + '(--multiply_timetraps)--multiply_timetraps' \ + '(--scale_timetraps)--scale_timetraps' \ + '(--create_priv_dir)--create_priv_dir' \ '(-v --verbose)'{-v,--verbose}'[Print coverage analysis]' \ + '(--auto_compile)--auto_compile' \ && ret=0 ;; (deps) -- cgit v1.1 From 9c0d819c126bf9fdfad9b688d7e385d0f15db6b4 Mon Sep 17 00:00:00 2001 From: Fred Hebert Date: Tue, 5 Jan 2016 19:46:40 -0500 Subject: contributors -> maintaiers in template app data hex.pm is now using maintainers instead of contributors in metadata. Templates should be updated to reflect it. --- priv/templates/otp_app.app.src | 2 +- priv/templates/otp_lib.app.src | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'priv') diff --git a/priv/templates/otp_app.app.src b/priv/templates/otp_app.app.src index 09e4a48..783a130 100644 --- a/priv/templates/otp_app.app.src +++ b/priv/templates/otp_app.app.src @@ -10,7 +10,7 @@ {env,[]}, {modules, []}, - {contributors, []}, + {maintainers, []}, {licenses, []}, {links, []} ]}. diff --git a/priv/templates/otp_lib.app.src b/priv/templates/otp_lib.app.src index f07293e..6e76b4b 100644 --- a/priv/templates/otp_lib.app.src +++ b/priv/templates/otp_lib.app.src @@ -9,7 +9,7 @@ {env,[]}, {modules, []}, - {contributors, []}, + {maintainers, []}, {licenses, []}, {links, []} ]}. -- cgit v1.1 From 3d0aa5e84a2b2a7158f1e4b2070fecd130a3e2bc Mon Sep 17 00:00:00 2001 From: Fred Hebert Date: Sun, 10 Jan 2016 11:44:37 -0500 Subject: Unquote templates, add a warning instead. --- priv/templates/app.erl | 4 ++-- priv/templates/escript_mod.erl | 2 +- priv/templates/escript_rebar.config | 6 +++--- priv/templates/gitignore | 6 +----- priv/templates/mod.erl | 2 +- priv/templates/otp_app.app.src | 4 ++-- priv/templates/otp_lib.app.src | 2 +- priv/templates/plugin.erl | 4 ++-- priv/templates/provider.erl | 4 ++-- priv/templates/relx_rebar.config | 4 ++-- priv/templates/sup.erl | 2 +- priv/templates/sys.config | 2 +- 12 files changed, 19 insertions(+), 23 deletions(-) (limited to 'priv') diff --git a/priv/templates/app.erl b/priv/templates/app.erl index 2e7b909..83eb9a3 100644 --- a/priv/templates/app.erl +++ b/priv/templates/app.erl @@ -3,7 +3,7 @@ %% @end %%%------------------------------------------------------------------- --module('{{name}}_app'). +-module({{name}}_app). -behaviour(application). @@ -16,7 +16,7 @@ %%==================================================================== start(_StartType, _StartArgs) -> - '{{name}}_sup':start_link(). + {{name}}_sup:start_link(). %%-------------------------------------------------------------------- stop(_State) -> diff --git a/priv/templates/escript_mod.erl b/priv/templates/escript_mod.erl index dd2feb8..f8a779b 100644 --- a/priv/templates/escript_mod.erl +++ b/priv/templates/escript_mod.erl @@ -1,4 +1,4 @@ --module('{{name}}'). +-module({{name}}). %% API exports -export([main/1]). diff --git a/priv/templates/escript_rebar.config b/priv/templates/escript_rebar.config index c0a3301..196f835 100644 --- a/priv/templates/escript_rebar.config +++ b/priv/templates/escript_rebar.config @@ -2,9 +2,9 @@ {deps, []}. {escript_incl_apps, - ['{{name}}']}. -{escript_top_level_app, '{{name}}'}. -{escript_name, '{{name}}'}. + [{{name}}]}. +{escript_top_level_app, {{name}}}. +{escript_name, {{name}}}. {escript_emu_args, "%%! +sbtu +A0\n"}. %% Profiles diff --git a/priv/templates/gitignore b/priv/templates/gitignore index a939dce..ced0c5e 100644 --- a/priv/templates/gitignore +++ b/priv/templates/gitignore @@ -11,9 +11,5 @@ ebin log erl_crash.dump .rebar -_rel -_deps -_plugins -_tdeps logs -_build \ No newline at end of file +_build diff --git a/priv/templates/mod.erl b/priv/templates/mod.erl index 208307e..2f5e09e 100644 --- a/priv/templates/mod.erl +++ b/priv/templates/mod.erl @@ -1,4 +1,4 @@ --module('{{name}}'). +-module({{name}}). %% API exports -export([]). diff --git a/priv/templates/otp_app.app.src b/priv/templates/otp_app.app.src index 783a130..243cef5 100644 --- a/priv/templates/otp_app.app.src +++ b/priv/templates/otp_app.app.src @@ -1,8 +1,8 @@ -{application, '{{name}}', +{application, {{name}}, [{description, "{{desc}}"}, {vsn, "0.1.0"}, {registered, []}, - {mod, {'{{name}}_app', []}}, + {mod, {{{name}}_app, []}}, {applications, [kernel, stdlib diff --git a/priv/templates/otp_lib.app.src b/priv/templates/otp_lib.app.src index 6e76b4b..5b98a51 100644 --- a/priv/templates/otp_lib.app.src +++ b/priv/templates/otp_lib.app.src @@ -1,4 +1,4 @@ -{application, '{{name}}', +{application, {{name}}, [{description, "{{desc}}"}, {vsn, "0.1.0"}, {registered, []}, diff --git a/priv/templates/plugin.erl b/priv/templates/plugin.erl index c6e5e40..218960d 100644 --- a/priv/templates/plugin.erl +++ b/priv/templates/plugin.erl @@ -1,8 +1,8 @@ --module('{{name}}'). +-module({{name}}). -export([init/1]). -spec init(rebar_state:t()) -> {ok, rebar_state:t()}. init(State) -> - {ok, State1} = '{{name}}_prv':init(State), + {ok, State1} = {{name}}_prv:init(State), {ok, State1}. diff --git a/priv/templates/provider.erl b/priv/templates/provider.erl index 669df83..7639d97 100644 --- a/priv/templates/provider.erl +++ b/priv/templates/provider.erl @@ -1,8 +1,8 @@ --module('{{name}}_prv'). +-module({{name}}_prv). -export([init/1, do/1, format_error/1]). --define(PROVIDER, '{{name}}'). +-define(PROVIDER, {{name}}). -define(DEPS, [app_discovery]). %% =================================================================== diff --git a/priv/templates/relx_rebar.config b/priv/templates/relx_rebar.config index da32819..eab99ac 100644 --- a/priv/templates/relx_rebar.config +++ b/priv/templates/relx_rebar.config @@ -1,8 +1,8 @@ {erl_opts, [debug_info]}. {deps, []}. -{relx, [{release, {'{{name}}', "0.1.0"}, - ['{{name}}', +{relx, [{release, {{{name}}, "0.1.0"}, + [{{name}}, sasl]}, {sys_config, "./config/sys.config"}, diff --git a/priv/templates/sup.erl b/priv/templates/sup.erl index cd9192a..a2e7209 100644 --- a/priv/templates/sup.erl +++ b/priv/templates/sup.erl @@ -3,7 +3,7 @@ %% @end %%%------------------------------------------------------------------- --module('{{name}}_sup'). +-module({{name}}_sup). -behaviour(supervisor). diff --git a/priv/templates/sys.config b/priv/templates/sys.config index 7fd6bcb..b587675 100644 --- a/priv/templates/sys.config +++ b/priv/templates/sys.config @@ -1,3 +1,3 @@ [ - {'{{name}}', []} + {{{name}}, []} ]. -- cgit v1.1 From 810b74326142f1f39cc98da6021c9fc9236a8045 Mon Sep 17 00:00:00 2001 From: Fred Hebert Date: Mon, 11 Jan 2016 14:54:49 -0500 Subject: Remove triple brackets in bbmustache templates Issues formerly were avoided by quoting atoms. Unquoting them created unbalanced tags (`{{{name}}`) which were mistakes. This patch inserts spaces to unconfused bbmustache. --- priv/templates/otp_app.app.src | 2 +- priv/templates/relx_rebar.config | 2 +- priv/templates/sys.config | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'priv') diff --git a/priv/templates/otp_app.app.src b/priv/templates/otp_app.app.src index 243cef5..c18f82c 100644 --- a/priv/templates/otp_app.app.src +++ b/priv/templates/otp_app.app.src @@ -2,7 +2,7 @@ [{description, "{{desc}}"}, {vsn, "0.1.0"}, {registered, []}, - {mod, {{{name}}_app, []}}, + {mod, { {{name}}_app, []}}, {applications, [kernel, stdlib diff --git a/priv/templates/relx_rebar.config b/priv/templates/relx_rebar.config index eab99ac..81b7dbe 100644 --- a/priv/templates/relx_rebar.config +++ b/priv/templates/relx_rebar.config @@ -1,7 +1,7 @@ {erl_opts, [debug_info]}. {deps, []}. -{relx, [{release, {{{name}}, "0.1.0"}, +{relx, [{release, { {{name}}, "0.1.0" }, [{{name}}, sasl]}, diff --git a/priv/templates/sys.config b/priv/templates/sys.config index b587675..d892fd6 100644 --- a/priv/templates/sys.config +++ b/priv/templates/sys.config @@ -1,3 +1,3 @@ [ - {{{name}}, []} + { {{name}}, []} ]. -- cgit v1.1 From 81483f9f5dc12adafc45fc549f536c1e18165f99 Mon Sep 17 00:00:00 2001 From: Tuncer Ayaz Date: Mon, 25 Jan 2016 22:52:57 +0100 Subject: bash completion: fix error introduced in cf66dfd6 cf66dfd6ba introduced a syntax error in the modified lopts string. Without the fix, you'll provoke a shell error when trying to complete `rebar3 ct --`. --- priv/shell-completion/bash/rebar3 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'priv') diff --git a/priv/shell-completion/bash/rebar3 b/priv/shell-completion/bash/rebar3 index 771297c..49427ef 100644 --- a/priv/shell-completion/bash/rebar3 +++ b/priv/shell-completion/bash/rebar3 @@ -74,8 +74,8 @@ _rebar3() --multiply_timetraps \ --scale_timetraps \ --create_priv_dir \ - --verbose" \ - --auto_compile + --verbose \ + --auto_compile" elif [[ ${prev} == deps ]] ; then : elif [[ ${prev} == dialyzer ]] ; then -- cgit v1.1 From 7c9dd6c1ecd298a6b207342f05b386adb9c412e5 Mon Sep 17 00:00:00 2001 From: Tuncer Ayaz Date: Mon, 25 Jan 2016 22:54:09 +0100 Subject: bash completion: prevent future mistakes in lopts To prevent future mistakes like the broken string introduced in cf66dfd6ba, put opening and closing " on separate lines in each multi-line lopts string. This also allows for cleaner (smaller) diffs when removing/adding a flag. --- priv/shell-completion/bash/rebar3 | 36 ++++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) (limited to 'priv') diff --git a/priv/shell-completion/bash/rebar3 b/priv/shell-completion/bash/rebar3 index 49427ef..3cd3cd7 100644 --- a/priv/shell-completion/bash/rebar3 +++ b/priv/shell-completion/bash/rebar3 @@ -10,7 +10,8 @@ _rebar3() if [[ ${prev} == rebar3 ]] ; then sopts="-h -v" lopts="--help --version" - cmdsnvars="as \ + cmdsnvars=" \ + as \ clean \ compile \ cover \ @@ -37,7 +38,8 @@ _rebar3() update \ upgrade \ version \ - xref" + xref \ + " elif [[ ${prev} == as ]] ; then : elif [[ ${prev} == clean ]] ; then @@ -50,7 +52,8 @@ _rebar3() lopts="--reset --verbose" elif [[ ${prev} == ct ]] ; then sopts="-c -v" - lopts="--dir \ + lopts=" \ + --dir \ --suite \ --group \ --case \ @@ -75,7 +78,8 @@ _rebar3() --scale_timetraps \ --create_priv_dir \ --verbose \ - --auto_compile" + --auto_compile \ + " elif [[ ${prev} == deps ]] ; then : elif [[ ${prev} == dialyzer ]] ; then @@ -97,7 +101,8 @@ _rebar3() lopts="--force" elif [[ ${prev} == path ]] ; then sopts="-s" - lopts="--app \ + lopts=" \ + --app \ --base \ --bin \ --ebin \ @@ -105,14 +110,16 @@ _rebar3() --priv \ --separator \ --src \ - --rel" + --rel \ + " elif [[ ${prev} == pkgs ]] ; then : elif [[ ${prev} == plugins ]] ; then : elif [[ ${prev} == release ]] ; then sopts="-n -v -g -u -o -h -l -p -V -d -i -a -c -r" - lopts="--relname \ + lopts=" \ + --relname \ --relvsn \ --goal \ --upfrom \ @@ -131,10 +138,12 @@ _rebar3() --sys_config \ --system_libs \ --version \ - --root" + --root \ + " elif [[ ${prev} == relup ]] ; then sopts="-n -v -g -u -o -h -l -p -V -d -i -a -c -r" - lopts="--relname \ + lopts=" \ + --relname \ --relvsn \ --goal \ --upfrom \ @@ -153,14 +162,16 @@ _rebar3() --sys_config \ --system_libs \ --version \ - --root" + --root \ + " elif [[ ${prev} == report ]] ; then : elif [[ ${prev} == shell ]] ; then : elif [[ ${prev} == tar ]] ; then sopts="-n -v -g -u -o -h -l -p -V -d -i -a -c -r" - lopts="--relname \ + lopts=" \ + --relname \ --relvsn \ --goal \ --upfrom \ @@ -179,7 +190,8 @@ _rebar3() --sys_config \ --system_libs \ --version \ - --root" + --root \ + " elif [[ ${prev} == tree ]] ; then sopts="-v" lopts="--verbose" -- cgit v1.1