fix(CLI): request value cursor handling and docs

* now the cursor will only be set permanently if the -r flag is used in
  'cursor' mode. In 'cursor=value' mode, the cursor change doesn't
  persist among the flags. That way, one can easily distinguish
  between setting the cursor, and setting a field. However,
  '...sublevel.level=value' will still work as it did previously, yet
  the cursor change will not persist.
* Documentation was adjusted to represent the new cursor style.

Fixes #86
This commit is contained in:
Sebastian Thiel
2015-04-26 07:49:19 +02:00
parent 2f3b2d24ce
commit b6a48bdcd5
4 changed files with 31 additions and 14 deletions

View File

@@ -95,6 +95,9 @@ impl${rb_params} ${ThisType} {
% endfor
% endif
pub fn ${mangle_ident(a)}${type_params}(&self${method_args}) -> ${RType}${mb_tparams} {
% if part_prop and request_value:
let parts = ${mangle_ident(REQUEST_VALUE_PROPERTY_NAME)}.to_parts();
% endif
${RType} {
hub: self.hub,
% for p in required_props:
@@ -102,7 +105,7 @@ impl${rb_params} ${ThisType} {
% endfor
## auto-generate parts from request resources
% if part_prop and request_value:
${property(part_prop.name)}: ${mangle_ident(REQUEST_VALUE_PROPERTY_NAME)}.to_parts(),
${property(part_prop.name)}: parts,
% endif
% for p in optional_props:
${property(p.name)}: Default::default(),