MetaScale/linux — pull request #1 by abak (2014-03-18 16:20:53+00:00)
Title: Script options fix

This pull request fixes the following issues :
* when passing custom arguments to a script, if those arguments are
not declared within perf, they prevent the execution of perf.
e.g.

perf script -i path/to/perf.data -s my_script -arg1 arg_value

perf will issue an error message and no processing will occur

* when passing custom arguments to a script, if those arguments are
declared by perf, they are consumed and not passed to the script.
e.g.
perf script -i path/to/perf.data -s my_script -h

perf will display its own help message, instead of the expected help
message from my_script.

These issues are addressed as follows :
* The parse option flag is changed from PARSE_OPT_STOP_AT_NON_OPTION to
PARSE_OPT_KEEP_UNKNOWN
* A new option type is introduce OPT_CALLBACK_FINAL_OPTION, which effectively
prevents the parsing of all options located after the script.

Signed-off-by: Adrien Bak

---