Change Svi::Cli to a class
This commit is contained in:
1 parent
d9334aa224
commit
6f55b3ddae
2 files changed
+5
-5
No files matched your search
@@ -4,4 +4,6 @@ require "svi"
|
||||
|
||||
args = ARGV.dup
|
||||
|
||||
exit(Svi::Cli.run(args))
|
||||
cli = Svi::Cli.new
|
||||
|
||||
exit(cli.run(args))
|
||||
+2
-4
@@ -1,8 +1,7 @@
|
||||
require "yawpa"
|
||||
|
||||
module Svi
|
||||
module Cli
|
||||
class << self
|
||||
class Cli
|
||||
|
||||
ALIASES = {
|
||||
"co" => "checkout",
|
||||
@@ -47,7 +46,7 @@ EOS
|
||||
end
|
||||
command_function = "cmd_#{subcommand}".to_sym
|
||||
if private_methods.include?(command_function)
|
||||
Cli.__send__(command_function, params)
|
||||
__send__(command_function, params)
|
||||
else
|
||||
$stderr.puts "Unknown command #{subcommand}"
|
||||
1
|
||||
@@ -73,4 +72,3 @@ EOS
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in new issue
Block a user