lib/release_notes/cli.rb in release_notes-0.1.3 vs lib/release_notes/cli.rb in release_notes-0.2.0

- old
+ new

@@ -1,23 +1,26 @@ require 'thor' require 'release_notes' require 'release_notes/version' require 'release_notes/versioning' +require 'release_notes/cli/broadcast' require 'release_notes/cli/helpers' require 'release_notes/generators/release_note' +require 'release_notes/generators/broadcast' module ReleaseNotes class CLI < Thor - + register(Broadcast, 'broadcast', 'broadcast [COMMAND]', 'Create a new broadcast or update Broadcast models') + package_name 'ReleaseNotes' map '-v' => :version - desc 'new', 'create a new release note' + desc 'new', 'Create a new release note' method_option :destination, :aliases => '-d', :default => ReleaseNotes.release_note_folder, :desc => 'relative location of release note folder' method_option :force, :aliases => '-f', :type => :boolean, :desc => 'overwrite files that already exist' - method_option :increment, :aliases => '-i', :default => 'patch', :banner => 'MODE', :desc => 'increment version by mode' + method_option :increment, :aliases => '-i', :default => 'patch', :banner => 'MODE', :desc => 'increment version by mode - "major", "minor", "patch"' method_option :message, :aliases => '-m', :desc => 'interactive release note bullet input' method_option :version, :aliases => '-V', :desc => 'use the given version number' def new if options[:version].nil? @@ -32,17 +35,17 @@ if options[:message] message = ReleaseNotes::CLI::Helpers.interactive_bullets(message) end ReleaseNotes::Generators::ReleaseNote.start([options[:destination], - message, - update_version, - "--force=#{options[:force] || false}"]) + message, + update_version, + "--force=#{options[:force] || false}"]) end - desc 'update', "update #{ReleaseNotes.release_note_model} model" + desc 'update', "Update #{ReleaseNotes.release_note_model} models" method_option :destination, :aliases => '-d', :default => ReleaseNotes.release_note_folder, :desc => 'relative location of release note folder' method_option :no_log, :aliases => '-n', :type => :boolean, :default => false, :desc => 'disable README.md log of release notes' method_option :reset, :aliases => '-r', :type => :boolean, :default => false, :desc => 'delete all model entries and rebuilds them' # method_option :version, :aliases => '-V', :desc => 'update only the given version number' @@ -106,10 +109,10 @@ say "#{ReleaseNotes.release_note_model} model successfully updated.", :green say "ReleaseNotes log successfully updated (see #{options[:destination]}/README.md).", :green unless options[:no_log] end - desc 'version', 'show version of release_notes' + desc 'version', 'Show version of release_notes' def version puts "ReleaseNotes #{ReleaseNotes::VERSION}" end \ No newline at end of file