lib/pragmater/cli.rb in pragmater-1.1.0 vs lib/pragmater/cli.rb in pragmater-1.2.0

- old
+ new

@@ -18,44 +18,44 @@ super args, options, config @configuration = Configuration.new Identity.file_name end desc "-a, [--add=ADD]", "Add pragma comments to source file(s)." - map %w(-a --add) => :add + map %w[-a --add] => :add method_option :comments, aliases: "-c", desc: "Pragma comments", type: :array, default: [] method_option :whitelist, aliases: "-w", desc: "File extension whitelist", type: :array, default: [] def add path settings = configuration.merge add: {comments: options[:comments], whitelist: options[:whitelist]} write path, settings, :add end desc "-r, [--remove=REMOVE]", "Remove pragma comments from source file(s)." - map %w(-r --remove) => :remove + map %w[-r --remove] => :remove method_option :comments, aliases: "-c", desc: "Pragma comments", type: :array, default: [] method_option :whitelist, aliases: "-w", desc: "File extension whitelist", type: :array, default: [] def remove path settings = configuration.merge remove: {comments: options[:comments], whitelist: options[:whitelist]} write path, settings, :remove end - desc "-e, [--edit]", "Edit #{Pragmater::Identity.label} settings in default editor." - map %w(-e --edit) => :edit + desc "-e, [--edit]", "Edit gem settings in default editor." + map %w[-e --edit] => :edit def edit resource_file = File.join ENV["HOME"], Pragmater::Identity.file_name info "Editing: #{resource_file}..." `#{editor} #{resource_file}` end - desc "-v, [--version]", "Show #{Pragmater::Identity.label} version." - map %w(-v --version) => :version + desc "-v, [--version]", "Show gem version." + map %w[-v --version] => :version def version say Pragmater::Identity.version_label end desc "-h, [--help=HELP]", "Show this message or get help for a command." - map %w(-h --help) => :help + map %w[-h --help] => :help def help task = nil - say && super + say and super end private attr_reader :configuration