This patch is my proposal in #3
The patch can be applied on your "fix-handling-options" branch.
It also includes your codes on "separate-options" branch.
Separate options into global_options, infile_options and outfile_opti…
infile_options are replicated for each input_files.
The detail was discussed in #3