Commits

sodas tsai  committed 28d8ac6

Fix argument parsing issue

  • Participants
  • Parent commits 603a4e0

Comments (0)

Files changed (1)

File beanstalk/bsjack

 
     # Task
     # Escaping '"'
-    tasks = ' '.join(map(lambda x: '"{0}"'.format(x.replace('"', r'\"')), sys.argv[1:]))
+    tasks = ' '.join(
+        [(component if component.startswith('-') else '"%s"' % component.replace('"', r'\"'))
+         for component in sys.argv[1:]])
 
     # Prepare for the command
     exec_context = {
         print ''
         print 'Usage: '
         print ''
-        print '    {0} command1:argument1-1,argument1-2 [command2:argument2-1,argument2-2 ...]'.format(command_name)
+        print '    {0} [options] <command>[:arg1,arg2=val2,host=foo,hosts=\'h1;h2\',...] ...'.format(command_name)
         print '    {0} --list'.format(command_name)
         print ''
         with hide('running'):
-            local('PYTHONPATH={python_path} fab -f {fab_file} --list'.format(**exec_context))
+            local('PYTHONPATH={python_path} fab -f {fab_file} -l -F nested'.format(**exec_context))
         print ''
         print 'Beanstalk-Stack is built with ' + green('Python-Fabric') + '.'
         print 'So you can pass all arguments for fabric to {0}.'.format(command_name)