Permalink
Browse files

bin/sin: updated for lookup changes and special modes

  • Loading branch information...
1 parent aefed26 commit f3e52b6fc7e5dae2c80d491b47e8c4f8c084d01e @daveadams committed Jun 21, 2012
Showing with 13 additions and 4 deletions.
  1. +13 −4 bin/sin
View
17 bin/sin
@@ -108,10 +108,13 @@ when "query" then
mode = args.shift
else
- # test to see if it's an accepted object mode
- if CLI::ObjectModes.keys.include? args[0]
+ # test to see if it's an accepted lookup mode
+ if CLI::LookupModes.keys.include? args[0]
mode = "lookup"
+ elsif CLI::SpecialModes.keys.include? args[0]
+ mode = "special"
+
else
STDERR.puts "ERROR: Command '#{args[0]}' was not recognized."
STDERR.puts "Run '#{File.basename($0)} help' for a list of commands."
@@ -138,9 +141,15 @@ if not db_name.nil?
DB.default_database = db_name
end
-if mode == "query"
+case mode
+when "query"
CLI::Query.process(args, flags)
-elsif mode == "lookup"
+
+when "lookup"
CLI::Lookup.process(args, flags)
+
+when "special"
+ CLI::Special.process(args, flags)
+
end

0 comments on commit f3e52b6

Please sign in to comment.