The most obvious bugs seems to be fixed.

Argument counting is coherent and optional arguments are parsed without
interferfering with positional arguments.
Optional argument may be associated to some action.