Ejemplo n.º 1
0
 def site_add_args(self, subparser):
     subparser.add_argument('site', help='the name of the site')
     subparser.add_argument('schema', help='the schema to use'
                            ).completer = completion.SchemataCompleter()
     subparser.add_argument('-N',
                            '--new-schema',
                            metavar='VALUE',
                            help='a schema value for the new schema')
Ejemplo n.º 2
0
def parser():
    parser = argparse.ArgumentParser()
    parser.add_argument('-x', '--ecks', help='x')
    parser.add_argument('-y', '--why', action='store_true', help='y')
    subparsers = parser.add_subparsers(dest='command')
    spam_subparser = subparsers.add_parser('spam', help='spam')
    spam_subparser.add_argument('--spam', help='spam')
    eggs_subparser = subparsers.add_parser('eggs', help='eggs')
    eggs_subparsers = eggs_subparser.add_subparsers(dest='eggs_command')
    eggs1_parser = eggs_subparsers.add_parser('eggs1', help='eggs1')
    eggs1_parser.add_argument('spam', help='spam')
    eggs1_parser.add_argument('eggs', help='eggs')
    eggs2_parser = eggs_subparsers.add_parser('eggs2', help='eggs2')
    eggs2_parser.add_argument(
        '--file', help='file').completer = completion.FilesCompleter()
    eggs2_parser.add_argument(
        '--schema', help='schema').completer = completion.SchemataCompleter()
    eggs2_parser.add_argument(
        '--site', help='site').completer = completion.SitesCompleter()
    eggs2_parser.add_argument(
        '--hash-method',
        help='hash-method').completer = completion.HashMethodsCompleter()
    return parser
Ejemplo n.º 3
0
 def schema_set_value_args(self, subparser):
     subparser.add_argument('name', help='the name of the schema'
                            ).completer = completion.SchemataCompleter()
     subparser.add_argument('value', help='the new value for the schema')
Ejemplo n.º 4
0
 def schema_set_name_args(self, subparser):
     subparser.add_argument('oldname', help='the schema to set the name of'
                            ).completer = completion.SchemataCompleter()
     subparser.add_argument('newname', help='the new name of the schema')
Ejemplo n.º 5
0
 def schema_remove_args(self, subparser):
     subparser.add_argument('name', help='the name of the schema to remove'
                            ).completer = completion.SchemataCompleter()
Ejemplo n.º 6
0
 def site_set_schema_args(self, subparser):
     subparser.add_argument('site', help='the name of the site to update'
                            ).completer = completion.SitesCompleter()
     subparser.add_argument('schema', help='the schema to use'
                            ).completer = completion.SchemataCompleter()