'''
Created on Jan 30, 2012

@author: guillaume.aubert@gmail.com
'''

from cmdline_utils  import CmdLineParser

if __name__ == '__main__':
    
    global_parser = CmdLineParser()
    global_parser.disable_interspersed_args()
    
    
@@ -103,16 +103,43 @@
 neParser
+%0Aimport argparse%0Aimport sys
 %0A%0Aif __n
@@ -172,85 +172,1448 @@
     
-global_parser = CmdLineParser()%0A    global_parser.disable_interspe
+parser = argparse.ArgumentParser()%0A    %0A    subparsers = parser.add_subparsers(help='commands')%0A    %0A    # A list command%0A    list_parser = subparsers.add_parser('sync', help='synchronize with given gmail account')%0A    list_parser.add_argument('email', action='store', help='email to sync with')%0A    list_parser.add_argument('-t', action='store', help='type of synchronisation')%0A    %0A    # A create command%0A    create_parser = subparsers.add_parser('create', help='Create a directory')%0A    create_parser.add_argument('dirname', action='store', help='New directory to create')%0A    create_parser.add_argument('--read-only', default=False, action='store_true',%0A                               help='Set permissions to prevent writing to the directory',%0A                               )%0A    %0A    # A delete command%0A    delete_parser = subparsers.add_parser('delete', help='Remove a directory')%0A    delete_parser.add_argument('dirname', action='store', help='The directory to remove')%0A    delete_parser.add_argument('--recursive', '-r', default=False, action='store_true',%0A                               help='Remove the contents of the directory, too',%0A                               )%0A    %0A    #sys.argv = %5B'gmvault.py', 'sync', '-h'%5D%0A    %0A    sys.argv = %5B'gmvault.py', 'sync', 'guillaume.aubert@gmail.com', '-t', 'full_sync'%5D%0A    %0A    print(parser.pa
 rse
-d
 _args()
+)%0A    %0A    #print(%22options = %25s%5Cn%22 %25 (options))%0A    #print(%22args = %25s%5Cn%22 %25 (args))%0A
 %0A   

add sandbox to experiment with cmdline