From 6679899c81520bce6b73de32f5f2f1c9258cdf00 Mon Sep 17 00:00:00 2001 From: masukomi Date: Tue, 9 Aug 2016 19:49:31 -0400 Subject: [PATCH] added tag support to cli partially addresss ticket #7 --- .changelog_entries/3f89da9c669a86550fa337302fa9ca48.json | 1 + src/changelog_entry_generator.cr | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 .changelog_entries/3f89da9c669a86550fa337302fa9ca48.json diff --git a/.changelog_entries/3f89da9c669a86550fa337302fa9ca48.json b/.changelog_entries/3f89da9c669a86550fa337302fa9ca48.json new file mode 100644 index 0000000..75cb92c --- /dev/null +++ b/.changelog_entries/3f89da9c669a86550fa337302fa9ca48.json @@ -0,0 +1 @@ +{"type":"Added","ticket":"7","url":"https://github.com/masukomi/changelog_manager/issues/7","description":"Added --with-tags=TAGS option enabling primary tag use-case","tags":[]} \ No newline at end of file diff --git a/src/changelog_entry_generator.cr b/src/changelog_entry_generator.cr index 1dfa533..808efcd 100644 --- a/src/changelog_entry_generator.cr +++ b/src/changelog_entry_generator.cr @@ -21,12 +21,15 @@ class ChangelogEntryGenerator end description = ask_for_non_optional_input("Describe your change: ") # TODO support tags + raw_tags = Readline.readline("Tags (Optional, comma separated): ") + tags = raw_tags.to_s.split(/,\s*/).select{|x| !x.nil? && x != ""} + # i don't trust them to follow instructions changelog_entry = ChangelogEntry.new(change_type, description, ticket.to_s == "" ? nil : ticket.to_s, url.to_s == "" ? nil : url.to_s, - [] of String) + tags) # puts changelog_entry.to_json new_entry_location = changelog_entry.export(cd) success = false