Permalink
Browse files

Removing subcommand/pickled_optparse combination in favor of cli.

  • Loading branch information...
1 parent 06be618 commit 772f9136cd0e6bee2c8f89c9289a1b14d2ce2736 @jdsumsion committed Jan 25, 2012
Showing with 40 additions and 43 deletions.
  1. +1 −2 git-ged.gemspec
  2. +1 −1 lib/git-ged.rb
  3. +38 −40 lib/git-ged/cli.rb
View
@@ -23,8 +23,7 @@ Gem::Specification.new do |s|
s.extra_rdoc_files = %w[README.md LICENSE LICENSE.grit TODO layout.txt]
s.add_dependency('grit', "~> 2.4.1")
- s.add_dependency('pickled_optparse', "~> 0.1.1")
- s.add_dependency('subcommand', "~> 1.0.6")
+ s.add_dependency('cli', "~> 1.1.0")
s.add_development_dependency('mocha')
View
@@ -23,7 +23,7 @@
# internal support classes
module GitGed
- VERSION = '0.0.3'
+ VERSION = '0.0.4'
class << self
View
@@ -1,52 +1,50 @@
#!/usr/bin/env ruby
require 'git-ged'
-require 'picled_optparse'
-require 'subcommand'
module GitGed
class CLI
- include Subcommands
-
- # patch until subcommand 1.0.7 comes out
- attr_accessor :appname
- def print_actions
- super.sub(/See '.* help COMMAND'/, "See '#{appname} help COMMAND'")
- end
-
- def initialize
- @options = {}
-
- self.appname = "git ged"
- global_options do |opts|
- opts.banner = "Usage: #{appname} [options] [subcommand [options]]"
- opts.separator ""
- opts.separator "Global options are:"
- opts.on("-v", "--[no-]verbose", "Show git-ged & grit debug") do |v|
- GitGed.debug = v
- end
- end
- add_help_option
-
- command :init do |opts|
- opts.banner = "Usage: #{appname} init -m msg [repo]"
- opts.description = "Initializes a new git-ged repo"
- opts.separator ""
- opts.separator "Options:"
- opts.on "-m INTENT", "--message INTENT" do |intent|
- @options[:intent] = intent
- end
- end
- end
+# include Subcommands
+#
+# # patch until subcommand 1.0.7 comes out
+# attr_accessor :appname
+# def print_actions
+# super.sub(/See '.* help COMMAND'/, "See '#{appname} help COMMAND'")
+# end
+
+# def initialize
+# @options = {}
+#
+# self.appname = "git ged"
+# global_options do |opts|
+# opts.banner = "Usage: #{appname} [options] [subcommand [options]]"
+# opts.separator ""
+# opts.separator "Global options are:"
+# opts.on("-v", "--[no-]verbose", "Show git-ged & grit debug") do |v|
+# GitGed.debug = v
+# end
+# end
+# add_help_option
+#
+# command :init do |opts|
+# opts.banner = "Usage: #{appname} init -m msg [repo]"
+# opts.description = "Initializes a new git-ged repo"
+# opts.separator ""
+# opts.separator "Options:"
+# opts.on "-m INTENT", "--message INTENT" do |intent|
+# @options[:intent] = intent
+# end
+# end
+# end
def run
- cmd = opt_parse()
- if cmd
- Repo.new.send cmd, ARGV, @options
- else
- puts global_options { |opts| opts }
- end
+# cmd = opt_parse()
+# if cmd
+# Repo.new.send cmd, ARGV, @options
+# else
+# puts global_options { |opts| opts }
+# end
end
end

0 comments on commit 772f913

Please sign in to comment.