bin/pave in pave-0.0.1 vs bin/pave in pave-0.0.2
- old
+ new
@@ -6,23 +6,40 @@
class App
include Methadone::Main
include Methadone::CLILogging
- main do |command| # Add args you want: |like,so|
+ main do |command, opt| # Add args you want: |like,so|
# your program code here
# You can access CLI options via
# the options Hash
- puts "pave - Command line tools for Concrete5."
- puts "By Jamon Holmgren"
+ 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."
+ description "Command line for Concrete5 websites."
#
# Accept flags via:
# on("--flag VAL","Some flag")
# options[flag] will contain VAL
#
@@ -30,13 +47,13 @@
# on("--[no-]switch","Some switch")
#
# Or, just call OptionParser methods on opts
#
# Require an argument
- # arg :some_arg
+ arg :command
#
# # Make an argument optional
- # arg :optional_arg, :optional
+ arg :opt, :optional
version Pave::VERSION
use_log_level_option