Skip to content

Commit

Permalink
req() option doesn't affect help sheet (Close #23)
Browse files Browse the repository at this point in the history
  • Loading branch information
arikon committed Oct 19, 2012
1 parent 7879d0d commit 1962334
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
8 changes: 7 additions & 1 deletion lib/arg.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions lib/opt.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion src/arg.coffee
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -95,7 +95,13 @@ exports.Arg = class Arg


_checkParsed: (opts, args) -> not args.hasOwnProperty(@_name) _checkParsed: (opts, args) -> not args.hasOwnProperty(@_name)


_usage: -> Color('lpurple', @_name.toUpperCase()) + ' : ' + @_title _usage: ->
res = []

res.push Color('lpurple', @_name.toUpperCase()), ' : ', @_title
if @_req then res.push ' ', Color('lred', '(required)')

res.join ''


_requiredText: -> 'Missing required argument:\n ' + @_usage() _requiredText: -> 'Missing required argument:\n ' + @_usage()


Expand Down
2 changes: 2 additions & 0 deletions src/opt.coffee
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -212,6 +212,8 @@ exports.Opt = class Opt


res.push ' : ', @_title res.push ' : ', @_title


if @_req then res.push ' ', Color('lred', '(required)')

res.join '' res.join ''


_requiredText: -> 'Missing required option:\n ' + @_usage() _requiredText: -> 'Missing required option:\n ' + @_usage()
Expand Down

0 comments on commit 1962334

Please sign in to comment.