Sha256: 8e54ff8a3344f030fd157d1d3a40c1a18eef2c4406896831420c41c1b7d80561

Contents?: true

Size: 1.12 KB

Versions: 1

Compression:

Stored size: 1.12 KB

Contents

#!/usr/bin/env ruby

require 'optparse'
require 'methadone'
require 'fav.rb'

class App
  include Methadone::Main
  include Methadone::CLILogging
  include Methadone::SH

  main do |command_name, *command_args|
    cmd = Fav::CommandFactory.makeCommand(options, command_name, command_args)
    cmd.run!
  end

  description "A utility for organizing your commonly used shell commands. Commands are stored in ~/.favs."

  #Define flags
  on("-a COMMAND_TEXT","--add", "Add a command to the list of favorites")
  on("-ls", "--list", "List available commands")
  on("-g GROUP_NAME","--group", "If used with -a flag, will add command to group. Otherwise will run command within group")
  on("-r","--remove", "Remove a command from the list of favorites")
  #
  # Specify switches via:
  on("--no_prompt", "Skip prompting when running a group of commands")
  #
  # Or, just call OptionParser methods on opts
  #
  # Require an argument
  arg :command_name, "Name of command", :optional
  #
  # # Make an argument optional
  # arg :optional_arg, :optional

  version Fav::VERSION

  @log_level = Logger::DEBUG
  logger.level = Logger::DEBUG

  go!
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
command-line-favs-0.0.1 bin/fav