Sha256: e8d516a94dc51171366d3d779e5b254cab2b54d8876ea2ddf1bbd91f109b2c49

Contents?: true

Size: 1.11 KB

Versions: 5

Compression:

Stored size: 1.11 KB

Contents

#!/usr/bin/env ruby

require 'optparse'
require 'methadone'
require 'pave.rb'

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

  main do |command, opt| # Add args you want: |like,so|
    # your program code here
    # You can access CLI options via
    # the options Hash
    info "pave - Command line tools for Concrete5."
    info "By Jamon Holmgren"

    case command.to_sym
    when :new then Pave::Concrete.create(opt)
    else show_help
    end

    0 # Good!
  end

  def self.show_help
    info "Invalid."
  end

  def self.create(name)
    info "Creating #{name}..."
    sleep 2
    info "Done."
  end

  # supplemental methods here

  # Declare command-line interface here

  description "Command line for Concrete5 websites."
  #
  # Accept flags via:
  # on("--flag VAL","Some flag")
  # options[flag] will contain VAL
  #
  # Specify switches via:
  # on("--[no-]switch","Some switch")
  #
  # Or, just call OptionParser methods on opts
  #
  # Require an argument
  arg :command
  #
  # # Make an argument optional
  arg :opt, :optional

  version Pave::VERSION

  use_log_level_option

  go!
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
pave-0.0.7 bin/pave
pave-0.0.6 bin/pave
pave-0.0.5 bin/pave
pave-0.0.4 bin/pave
pave-0.0.2 bin/pave