-
Notifications
You must be signed in to change notification settings - Fork 192
Open
Description
It would be nice to be able to specify config files containing CLI args, and when a CLI app is ran the args in those files would be added on (though with duplicate args being overwritten). This also helps more closely Integrate config files and the arg parser.
An example of what I mean:
# script.py
from plumbum import cli, local
class MyApp(cli.Application):
myarg = cli.SwitchAttr(["--myarg"], str, mandatory=True)
@cli.configs(local.path("~/.config/myapp/config.cfg"))
def main(self):
print("myarg: ", self.myarg)
MyApp.run()# ~/.config/myapp/config.cfg
--myarg=foobar$ python script.py
myarg: foobar
$ python script.py --help
Usage:
script.py [SWITCHES] args...
Argument config files:
~/.config/myapp/config.cfgMetadata
Metadata
Assignees
Labels
No labels