feat(CLI): repeated required args

* Seem to work for docopt, mkdocs and code itself
* mkdocs now show type of required params
* some code which deals with converting elements to their
  target types is totally untested right now.

Related to #77
This commit is contained in:
Sebastian Thiel
2015-04-22 10:28:13 +02:00
parent a4b73cc1c4
commit c14ef9afc8
4 changed files with 20 additions and 5 deletions

View File

@@ -121,6 +121,11 @@ def actual_json_type(name, type):
return 'int64'
return type
# return a string representing property `p` suitable for docopt argument parsing
def to_docopt_arg(p):
return '<%s>%s' % (mangle_subcommand(p.name), p.get('repeated', False) and '...' or '')
# Return schema' with fields dict: { 'field1' : SchemaField(...), 'SubSchema': schema' }
def to_cli_schema(c, schema):
res = deepcopy(schema)