yoda: Move cparser generator into function

This is "plus one \t" for half of the script :( Plus
yname move to global space.

Signed-off-by: Pavel Emelyanov <xemul@sacred.ru>
yoda: Bash completion generator skeleton

Signed-off-by: Pavel Emelyanov <xemul@sacred.ru>
criu: Fix type for --file argument

Signed-off-by: Pavel Emelyanov <xemul@sacred.ru>
yoda: Introduce (rather stupid) bash completion generation

Generation logic is like below:

1. If prev is ano option with argument -- complete argument
2. Scan current cmdline, properly skipping opts with args, for
   argument that switches options array, and report _this_
   arg array and gen options
3. If nothing of above met -- report switching-arg choices
   and generic options.

Wrong? Most likely yes, but works for typical usages of existing
examples/ tools.

Signed-off-by: Pavel Emelyanov <xemul@sacred.ru>
yoda: Fix bashcomp ctx-scan for no-options choices

Signed-off-by: Pavel Emelyanov <xemul@sacred.ru>