From 5c7a93d6afdb4926431a67eef2755cf5134d4b4c Mon Sep 17 00:00:00 2001 From: Shubham Shukla Date: Sat, 21 May 2016 17:44:51 +0530 Subject: [PATCH 1/2] Take title and description on cmdline for milestone just like open Now `ghi milestone sample_title -m sample_description` will create a milestone with title as sample_title and description as sample_description. Fixes #303 --- ghi | 3 +++ lib/ghi/commands/milestone.rb | 3 +++ 2 files changed, 6 insertions(+) diff --git a/ghi b/ghi index c41c2c7..7a394c9 100755 --- a/ghi +++ b/ghi @@ -2743,6 +2743,9 @@ EOF if web Web.new(repo).open 'issues/milestones/new' else + unless args.empty? + assigns[:title], assigns[:description] = args.join(' '), assigns[:title] + end if assigns[:title].nil? e = Editor.new 'GHI_MILESTONE.md' message = e.gets format_milestone_editor diff --git a/lib/ghi/commands/milestone.rb b/lib/ghi/commands/milestone.rb index 65956ae..88a9366 100644 --- a/lib/ghi/commands/milestone.rb +++ b/lib/ghi/commands/milestone.rb @@ -139,6 +139,9 @@ def execute if web Web.new(repo).open 'issues/milestones/new' else + unless args.empty? + assigns[:title], assigns[:description] = args.join(' '), assigns[:title] + end if assigns[:title].nil? e = Editor.new 'GHI_MILESTONE.md' message = e.gets format_milestone_editor From 8c0b64d11adf36605ebf84885d5dfdc6ca65a78e Mon Sep 17 00:00:00 2001 From: Shubham Shukla Date: Sun, 22 May 2016 15:40:17 +0530 Subject: [PATCH 2/2] Take title and description on cmdline for edit just like open --- ghi | 3 +++ lib/ghi/commands/edit.rb | 3 +++ 2 files changed, 6 insertions(+) diff --git a/ghi b/ghi index 7a394c9..d05e778 100755 --- a/ghi +++ b/ghi @@ -1997,6 +1997,9 @@ EOF case action when 'edit' begin + unless args.empty? + assigns[:title], assigns[:body] = args.join(' '), assigns[:title] + end if editor || assigns.empty? i = throb { api.get "/repos/#{repo}/issues/#{issue}" }.body e = Editor.new "GHI_ISSUE_#{issue}.md" diff --git a/lib/ghi/commands/edit.rb b/lib/ghi/commands/edit.rb index 4f46569..fa88e04 100644 --- a/lib/ghi/commands/edit.rb +++ b/lib/ghi/commands/edit.rb @@ -68,6 +68,9 @@ def execute case action when 'edit' begin + unless args.empty? + assigns[:title], assigns[:body] = args.join(' '), assigns[:title] + end if editor || assigns.empty? i = throb { api.get "/repos/#{repo}/issues/#{issue}" }.body e = Editor.new "GHI_ISSUE_#{issue}.md"