The stupid question is the question not asked | |
PerlMonks |
Re: [General] Non-Specific Options Questionby Discipulus (Canon) |
on Aug 02, 2017 at 07:31 UTC ( [id://1196516]=note: print w/replies, xml ) | Need Help?? |
Hello arblargan, Command line centric? well if you do not like this you can easily go for configuration file option. Config::General and Config::Any can be valid options and if you want configuration in JSON you can go with JSON::MaybeXS But really you do not have to choose between command line options versus configuration file: you can have both! I'm really a fan of The Dynamic Duo --or-- Holy Getopt::Long, Pod::UsageMan! and I suggest you to use this approach as base. Then you can specify the possibility to import the configuration via config file overriding option passed via command line: put this very clearly stated in the documentation and if possible warn the user about this behaviour of your application. You can also use Modules as configuration files if it is the case. As pseudocode I suggest something like:
L* PS you can be also see default option How do I process many (conflicting) command line parameters? GetOpt Organization and getopt::std to pass arguments to command line help to find some inspiration
There are no rules, there are no thumbs.. Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.
In Section
Seekers of Perl Wisdom
|
|