Browse Source

Allow abbreviated names for all commands like rails does, e.g. 'shopify c' instead of 'shopify console'

Dennis Theisen 14 years ago
parent
commit
0f16d1a51a
1 changed files with 5 additions and 0 deletions
  1. 5 0
      lib/shopify_api/cli.rb

+ 5 - 0
lib/shopify_api/cli.rb

@@ -1,4 +1,5 @@
 require 'thor'
+require 'abbrev'
 
 module ShopifyAPI
   class Cli < Thor
@@ -6,6 +7,10 @@ module ShopifyAPI
     
     class ConfigFileError < StandardError
     end
+
+    tasks.keys.abbrev.each do |shortcut, command|
+      map shortcut => command.to_sym
+    end
     
     desc "list", "list available connections"
     def list