Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read first command-line argument as config file #28

Closed
calebbraun opened this issue Nov 28, 2018 · 4 comments
Closed

Read first command-line argument as config file #28

calebbraun opened this issue Nov 28, 2018 · 4 comments

Comments

@calebbraun
Copy link
Contributor

Running Xanthos from the command line requires the first (only) argument to be the configuration file:

python xanthos/model.py example/pm_abcd_mrtm.ini

This errors because the flag -config_file was not specified. We should assume any extra argument is the -config_file parameter.

@rplzzz
Copy link
Contributor

rplzzz commented Nov 28, 2018

If that's the intended use, then why not just drop the - in this line?

parser.add_argument('-config_file', type=str, help='Full path with file name to INI configuration file.')

That should make the configuration file a positional rather than flag-type argument.

@crvernon
Copy link
Member

We could do this for the current setup, but the goal was to get users used to the behavior incase we ever extended the args.

@rplzzz
Copy link
Contributor

rplzzz commented Nov 28, 2018

I think the best practice is usually to make mandatory arguments positional, while flags are mostly optional arguments.

@crvernon
Copy link
Member

Ok, that sounds reasonable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants