3 ms·
A genuine question. How come command line options are passed like so: python my_app.py db.driver=mysql db.user=omry No intention to criticize. Just wonderin
by tyrion 7y ago
A genuine question. How come command line options are passed like so:
python my_app.py db.driver=mysql db.user=omry
No intention to criticize. Just wondering if there is any reason you did not choose the more standard way:
python my_app.py --db-driver=mysql
Wouldn't it be nice if all CLI applications could agree on a way to pass parameters? :S
- omry 7y agoSomething like this could be implemented, but Hydra is using argparse for a few basic flags (--help, --run, --cfg etc) and argparse would not like us passing arbitrary undefined flags. Philosophically speaking, I am not seeing a big advantage for Hydra overrides syntax to line up with getopt. What it does is different. For example, unlike with getopt - you MUST specify a value with every override, there is no support for flags like --verbose. it would have to be verbose=true, the reason is that those are editing the configuration object, and in 99% of the cases you want to put in a value and not default to true. Also, you should be thinking of those command line arguments as editing a complex object. db.driver=mysql means: in the db map, change value of the driver key to mysql.