cmdline: better feedback

- warn about "loose" arguments (not belonging to an option)
- provide method returning the number of options found