Permalink
Browse files

milk のサブコマンドヘルプの調整

1. grep -h はそのまま横流し
2. add で引数無しの時もヘルプを表示
  • Loading branch information...
1 parent 2dc238a commit 740d47fb242ff1c140da64fcb2dc458078a5e121 @ongaeshi committed May 8, 2012
Showing with 6 additions and 2 deletions.
  1. +6 −2 lib/milkode/cli.rb
View
@@ -35,7 +35,11 @@ def init(db_dir = nil)
option :verbose, :type => :boolean, :aliases => '-v', :desc => 'Be verbose.'
def add(*args)
- cdstk.add(args, options)
+ if args.empty?
+ CLI.task_help(shell, "add")
+ else
+ cdstk.add(args, options)
+ end
end
desc "update [keyword1 keyword2 ...]", "Update database"
@@ -160,7 +164,7 @@ def shell
# デフォルトメソッドを上書きして -h を処理
# defined in /lib/thor/invocation.rb
def invoke_task(task, *args)
- if options[:help]
+ if options[:help] && task.name != 'grep'
CLI.task_help(shell, task.name)
else
super

0 comments on commit 740d47f

Please sign in to comment.