Permalink
Browse files

Replace the verbose option with the debug option

  • Loading branch information...
1 parent 572b22a commit 1d0ae2169653426d0afae72bbd11dfbb39c74a28 @Maher4Ever Maher4Ever committed May 31, 2012
Showing with 26 additions and 24 deletions.
  1. +1 −0 CHANGELOG.md
  2. +6 −5 README.md
  3. +2 −2 lib/guard.rb
  4. +4 −4 lib/guard/cli.rb
  5. +3 −3 lib/guard/ui.rb
  6. +1 −1 man/guard.1
  7. +2 −2 man/guard.1.html
  8. +3 −3 man/guard.1.ronn
  9. +1 −1 spec/guard/dsl_spec.rb
  10. +3 −3 spec/guard_spec.rb
View
1 CHANGELOG.md
@@ -3,6 +3,7 @@
### Improvements
- Listening is now handled by the [Listen gem](https://github.com/guard/listen).
+- Replace the `--verbose` option with the `--debug` option.
- New `--latency`/`-l` option to overwrite Listen's default latency.
- New `--force-polling`/`-p` option to force usage of the Listen polling listener.
- `--watch-all-modifications`/`-A` option is removed and is now always on.
View
11 README.md
@@ -285,13 +285,14 @@ $ guard -g group_name another_group_name # shortcut
See the Guardfile DSL below for creating groups.
-#### `-v`/`--verbose` option
+#### `-d`/`--debug` option
-Guard can be run in verbose mode:
+Guard can display debug information which can be very usefull for plugins
+developers with:
```bash
-$ guard --verbose
-$ guard -v # shortcut
+$ guard --debug
+$ guard -d # shortcut
```
#### `-w`/`--watchdir` option
@@ -879,7 +880,7 @@ using?
When you file a bug, please try to follow these simple rules if applicable:
* Make sure you run Guard with `bundle exec` first.
-* Add verbose information to the issue by running Guard with the `--verbose` option.
+* Add debug information to the issue by running Guard with the `--debug` option.
* Add your `Guardfile` and `Gemfile` to the issue.
* Make sure that the issue is reproducible with your description.
View
4 lib/guard.rb
@@ -33,7 +33,7 @@ class << self
#
# @option options [Boolean] clear if auto clear the UI should be done
# @option options [Boolean] notify if system notifications should be shown
- # @option options [Boolean] verbose if verbose output should be shown
+ # @option options [Boolean] debug if debug output should be shown
# @option options [Array<String>] group the list of groups to start
# @option options [String] watchdir the director to watch
# @option options [String] guardfile the path to the Guardfile
@@ -54,7 +54,7 @@ def setup(options = {})
setup_listener
setup_signal_traps
- debug_command_execution if @options[:verbose]
+ debug_command_execution if @options[:debug]
Dsl.evaluate_guardfile(options)
UI.error 'No guards found in Guardfile, please add at least one.' if @guards.empty?
View
8 lib/guard/cli.rb
@@ -25,11 +25,11 @@ class CLI < Thor
:aliases => '-n',
:banner => 'Notifications feature (growl/libnotify)'
- method_option :verbose,
+ method_option :debug,
:type => :boolean,
:default => false,
- :aliases => '-v',
- :banner => 'Show verbose messages'
+ :aliases => '-d',
+ :banner => 'Show debug information'
method_option :group,
:type => :array,
@@ -78,7 +78,7 @@ class CLI < Thor
:type => :numeric,
:aliases => '-l',
:banner => 'Overwrite Listen\'s default latency'
-
+
method_option :force_polling,
:type => :boolean,
:default => false,
View
6 lib/guard/ui.rb
@@ -68,7 +68,7 @@ def deprecation(message, options = { })
def debug(message, options = { })
unless ENV['GUARD_ENV'] == 'test'
reset_line if options[:reset]
- STDERR.puts color("DEBUG (#{Time.now.strftime('%T')}): ", :yellow) + message if ::Guard.options && ::Guard.options[:verbose]
+ STDERR.puts color("DEBUG (#{Time.now.strftime('%T')}): ", :yellow) + message if ::Guard.options && ::Guard.options[:debug]
end
end
@@ -83,7 +83,7 @@ def reset_line
def clear
system('clear;') if ::Guard.options[:clear]
end
-
+
# Show a scoped action message.
#
# @param [String] action the action to show
@@ -93,7 +93,7 @@ def action_with_scopes(action, scopes)
scope_message ||= scopes[:guard]
scope_message ||= scopes[:group]
scope_message ||= 'all'
-
+
info "#{action} #{scope_message}"
end
View
2 man/guard.1
@@ -27,7 +27,7 @@ The following options are available:
\fB\-n\fR, \fB\-\-notify\fR \fIFLAG\fR Disable notifications (Growl or Libnotify depending on your system)\. Notifications can be disabled globally by setting a GUARD_NOTIFY environment variable to false\. FLAG can be \fBtrue\fR/\fBfalse\fR or \fBt\fR/\fBf\fR\.
.
.P
-\fB\-v\fR, \fB\-\-verbose\fR Runs Guard in verbose mode\.
+\fB\-d\fR, \fB\-\-debug\fR Runs Guard in debug mode\.
.
.P
\fB\-g\fR, \fB\-\-group\fR \fIGROUP1\fR \fIGROUP2\fR\.\.\. Runs only the groups specified by GROUP1, GROUP2 etc\. Groups name should be separated by spaces\. Guards that don\'t belong to a group are considered global and are always run\.
View
4 man/guard.1.html
@@ -97,8 +97,8 @@ <h3 id="start">start</h3>
Notifications can be disabled globally by setting a GUARD_NOTIFY environment variable to false.
FLAG can be <code>true</code>/<code>false</code> or <code>t</code>/<code>f</code>.</p>
-<p><code>-v</code>, <code>--verbose</code>
- Runs Guard in verbose mode.</p>
+<p><code>-d</code>, <code>--debug</code>
+ Runs Guard in debug mode.</p>
<p><code>-g</code>, <code>--group</code> <var>GROUP1</var> <var>GROUP2</var>...
Runs only the groups specified by GROUP1, GROUP2 etc.
View
6 man/guard.1.ronn
@@ -25,8 +25,8 @@ The following options are available:
Notifications can be disabled globally by setting a GUARD_NOTIFY environment variable to false.
FLAG can be `true`/`false` or `t`/`f`.
-`-v`, `--verbose`
- Runs Guard in verbose mode.
+`-d`, `--debug`
+ Runs Guard in debug mode.
`-g`, `--group` <GROUP1> <GROUP2>...
Runs only the groups specified by GROUP1, GROUP2 etc.
@@ -95,4 +95,4 @@ This manual has been written by Remy Coutable.
## WWW
-https://github.com/guard/guard
+https://github.com/guard/guard
View
2 spec/guard/dsl_spec.rb
@@ -8,7 +8,7 @@
@home_guardfile_path = File.expand_path(File.join("~", ".Guardfile"))
@user_config_path = File.expand_path(File.join("~", ".guard.rb"))
::Guard.setup
- ::Guard.stub!(:options).and_return(:verbose => true)
+ ::Guard.stub!(:options).and_return(:debug => true)
::Guard.stub!(:guards).and_return([mock('Guard')])
end
View
6 spec/guard_spec.rb
@@ -36,7 +36,7 @@
it "logs command execution if the debug option is true" do
described_class.should_receive(:debug_command_execution)
- described_class.setup(:verbose => true)
+ described_class.setup(:debug => true)
end
it "call setup_signal_traps" do
@@ -731,13 +731,13 @@ class Inline < Guard
end
it "outputs Kernel.#system method parameters" do
- ::Guard.setup(:verbose => true)
+ ::Guard.setup(:debug => true)
::Guard::UI.should_receive(:debug).with("Command execution: exit 0")
system("exit", "0").should be_false
end
it "outputs Kernel.#` method parameters" do
- ::Guard.setup(:verbose => true)
+ ::Guard.setup(:debug => true)
::Guard::UI.should_receive(:debug).twice.with("Command execution: echo test")
`echo test`.should == "test\n"
%x{echo test}.should == "test\n"

0 comments on commit 1d0ae21

Please sign in to comment.