lib/pronto/cli.rb in pronto-0.11.0 vs lib/pronto/cli.rb in pronto-0.11.1

- old
+ new

@@ -18,11 +18,10 @@ type: :boolean, desc: 'Exits with non-zero code if there were any warnings/errors.' method_option :commit, type: :string, - default: 'master', aliases: '-c', desc: 'Commit for the diff' method_option :unstaged, type: :boolean, @@ -31,10 +30,15 @@ method_option :staged, type: :boolean, desc: 'Analyze changes in git staging area' + method_option :workdir, + type: :boolean, + aliases: ['-w'], + desc: 'Analyze both staged and unstaged changes' + method_option :runner, type: :array, default: [], aliases: '-r', desc: 'Run only the passed runners' @@ -53,10 +57,10 @@ require "pronto/#{gem_name}" end formatters = ::Pronto::Formatter.get(options[:formatters]) - commit_options = %i[staged unstaged index] + commit_options = %i[workdir staged unstaged index] commit = commit_options.find { |o| options[o] } || options[:commit] repo_workdir = ::Rugged::Repository.discover(path).workdir relative = path.sub(repo_workdir, '')