---
feature_story: FS_55_57_45_04
feature_title: demo logic
feature_status: TODO
---

This article describes how command line processing works
using example of default config and demo data set (TD_63_37_05_36).

The command line tokens are translated to typed args.
A user keeps adding the typed arg values with auto-completion
until all requited types unambiguously specify what to do:
    `[some_command] rw upstream goto amer`
TODO: add test case confirming the shown example
The order is (usually) not important.

If there is an ambiguity, auto-completion suggests possible options -
in this case, the missing option is `CodeMaturity` ("prod", "qa", "dev", ...):
    `[some_command] rw upstream goto amer prod`
TODO: add test case confirming the shown example

Each arg value belongs to its own type (see :class:`ServiceArgType`), for example:
*   "rw": `AccessType`
*   "upstream": `FlowStage`
*   "goto": `ActionType`
*   "amer": `GeoRegion`
*   "prod": `CodeMaturity`
These types are:
*   discrete (limited set of values) and
*   non-orthogonal (possible values of one type may affect/depend on already given values for another type).

The arg type for the value is determined in several attempts:
*   In case of named args, the arg type is known by its mapping from key to type.
*   If it is positional arg, next unspecified arg type is assumed, and typed value set is checked for that value.
*   if value is not in the arg type value set, then the value is unconsumed.
