If you can live with a modification of your command-line argument rules, you can make this all pretty simple.
Rule 2b: The configuration file overrides command-line options occuring before it is specified, is overridden by those occuring after.
With that, you only need to process the config file as soon as it is specified. To get the behavior you wanted, your user would just have to name the config file first.
After Compline,
Zaxo
In reply to Re: command line args - a chicken and egg problem
by Zaxo
in thread command line args - a chicken and egg problem
by pileofrogs
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |