Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

add '-?' opt for usage as well #8

Merged
merged 1 commit into from

2 participants

@trentm

as requested

@davepacheco davepacheco merged commit 20d30cc into davepacheco:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 9, 2012
  1. @trentm

    add '-?' opt for usage as well

    trentm authored
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 3 deletions.
  1. +3 −3 jsstyle
View
6 jsstyle
@@ -55,7 +55,7 @@ use Getopt::Std;
use strict;
my $usage =
-"Usage: jsstyle [-hvcC] [-t <num>] [-f <path>] [-o <config>] file ...
+"Usage: jsstyle [-h?vcC] [-t <num>] [-f <path>] [-o <config>] file ...
Check your JavaScript file for style.
See <https://github.com/davepacheco/jsstyle> for details on config options.
@@ -78,12 +78,12 @@ Options:
my %opts;
-if (!getopts("cho:t:f:vC", \%opts)) {
+if (!getopts("ch?o:t:f:vC", \%opts)) {
print $usage;
exit 2;
}
-if (defined($opts{'h'})) {
+if (defined($opts{'h'}) || defined($opts{'?'})) {
print $usage;
exit;
}
Something went wrong with that request. Please try again.