Skip to content

Commit

Permalink
Merge pull request #448 from srenatus/sr/add-verbosity-to-cli-options
Browse files Browse the repository at this point in the history
Add `--verbose` flag, setting verbose app env option
  • Loading branch information
Brujo Benavides authored Jun 6, 2017
2 parents 053db5b + 671e98e commit 2a42880
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/elvis.erl
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,12 @@ option_spec_list() ->
"Show available commands."},
{output_format, undefined, "output-format", string,
OutputFormat},
{quiet, $q, "quiet", undefined,
"Suppress all output."},
{verbose, $V, "verbose", undefined,
"Enable verbose output."},
{version, $v, "version", undefined,
"Specify the elvis current version."},
"Output the current elvis version."},
{code_path, $p, "code-path", string,
"Add the directory in the code path."},
{keep_rocking, $k, "keep-rocking", undefined,
Expand Down Expand Up @@ -106,6 +110,12 @@ process_options([{output_format, Format} | Opts], Cmds, Config) ->
process_options([keep_rocking | Opts], Cmds, Config) ->
ok = application:set_env(elvis, keep_rocking, true),
process_options(Opts, Cmds, Config);
process_options([quiet | Opts], Cmds, Config) ->
ok = application:set_env(elvis, no_output, true),
process_options(Opts, Cmds, Config);
process_options([verbose | Opts], Cmds, Config) ->
ok = application:set_env(elvis, verbose, true),
process_options(Opts, Cmds, Config);
process_options([version | Opts], Cmds, Config) ->
version(),
process_options(Opts, Cmds, Config);
Expand Down

0 comments on commit 2a42880

Please sign in to comment.