main.c: set -S twice! And about command line processing..
commit9e423f065388be2c627109cc98fbcaba9d8f5bf3
authorSteffen "Daode" Nurpmeso <sdaoden@users.sf.net>
Thu, 18 Oct 2012 17:00:02 +0000 (18 19:00 +0200)
committerSteffen "Daode" Nurpmeso <sdaoden@users.sf.net>
Thu, 18 Oct 2012 19:13:02 +0000 (18 21:13 +0200)
treee177382d9d7445a2cb0c5ecece44b039e2914844
parent871dcfbdb13170f3e3fc831dbd31deb3bb6bb0e1
main.c: set -S twice!  And about command line processing..

It turned out that (Delay -S option processing until after RC
file loading.., 2012-09-18) has the weakness that anything which
happens during command line parsing is not affected.

This is bad.

So we have to set any -S variable twice, once directly when it
is parsed, so that it can affect all the following options and
everything which refers to it before the resource files are
loaded, and then once again after the resource files are loaded.

This is also bad, but much, much better.

I've already added a TODO note on that, but, again, the best
would be if anything that does more than setting a flag would be
skipped on the first parse, then the resource files would be
loaded, followed by a second parse of the command line.

Another option would be to store all arguments that need
a second processing stage in some temporary storage, and only
work that after the command line has been parsed once.  (In fact
the approach chosen for -S may be reworked for that, i.e., copy
back all arguments in the command line so that for the second
run only those arguments remain that actually need that.)

Anyway, the documentation yet states exactly how -S options
should act: they should affect *anything*, but may also not
become overwritten by ressource file content.
For this to be true even after whatever rewrite, it may be
necessary to set any -S option twice even in the future ;/
main.c
nail.1