[mythtv] Ticket #10722: mythshutdown -l isn't recognised

Raymond Wagner raymond at wagnerrp.com
Wed May 16 17:10:00 UTC 2012


On 5/16/2012 05:28, John Veness wrote:
> As far as I can tell, the only reason it no longer works in because of
> the blanket prohibition of -l/--logfile added in
> mythtv/libs/libmythbase/mythcommandlineparser.cpp. This blanket change
> makes sense for many of the myth commands but doesn't make sense for
> mythshutdown which never used -l to mean --logfile.

 From the user point of view, the only thing that makes sense is to keep 
command line parameters as consistent as possible between applications. 
The goal of the command line parser rewrite was to move everything to a 
single parser loop, with as many shared options as possible, in order to 
achieve that. Traditionally, '-l' is to specify the log file to output 
to, so the use in mythshutdown loses out for overall consistency.

> Can there not be an exception made such the "-l" can still work for
> mythshutdown (where it never meant "--logfile") but prohibit it for
> other myth commands (where it did used to mean "--logfile")? This may
> mean moving code out of
> mythtv/libs/libmythbase/mythcommandlineparser.cpp and into individual
> command parsers, where it is appropriate.

The parser merely stores the first definition for a particular argument, 
and ignores the rest.  In the case of mythshutdown, since the logging 
parameters are defined at the top, the later redefinition for 'lock' is 
ignored. I've added a separate definition in earlier to specifically 
mark it as removed, and clear up any confusion.



mythbuild_025# mythshutdown -l
****************************************************
  WARNING: -l has been removed
           Please use the full argument '--lock' instead.
****************************************************


More information about the mythtv-dev mailing list