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

@@ -5,7 +5,7 @@
from cli import (subcommand_md_filename, new_method_context, SPLIT_START, SPLIT_END, pretty, SCOPE_FLAG,
mangle_subcommand, is_request_value_property, FIELD_SEP, PARAM_FLAG, UPLOAD_FLAG, docopt_mode,
FILE_ARG, MIME_ARG, OUT_ARG, OUTPUT_FLAG, to_cli_schema, cli_schema_to_yaml, SchemaEntry,
STRUCT_FLAG, field_to_value, CTYPE_ARRAY, CTYPE_MAP)
STRUCT_FLAG, field_to_value, CTYPE_ARRAY, CTYPE_MAP, to_docopt_arg)
from copy import deepcopy
@@ -51,8 +51,11 @@ You can set the scope for this method like this: `${util.program_name()} --${SCO
% if rprops:
# Required Scalar ${len(rprops) > 1 and 'Arguments' or 'Argument'}
% for p in rprops:
* **<${mangle_subcommand(p.name)}\>**
* **${to_docopt_arg(p) | xml_escape}** *(${p.type})*
- ${p.get('description') or NO_DESC | xml_escape, indent_all_but_first_by(2)}
% if p.get('repeated'):
- This property can be specified one or more times
% endif
% endfor # each required property (which is not the request value)
% endif # have required properties
% if mc.request_value: