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

Make --binary optional (<FILE> should be a positional argument) #78

Open
ssokolow opened this issue Oct 18, 2019 · 1 comment
Open

Make --binary optional (<FILE> should be a positional argument) #78

ssokolow opened this issue Oct 18, 2019 · 1 comment

Comments

@ssokolow
Copy link

It's bad UI design to have required option flags on a command-line tool. In fact, the documentation for Python's in-stdlib argument parsing library explicitly teaches people to avoid it.

This...

rustig [FLAGS] [OPTIONS] --binary <FILE>

...should be this...

rustig [FLAGS] [OPTIONS] <FILE>

Requiring --binary or -b before what could be a positional argument just makes the command more awkward to type without any improvement in its expressive power.

@ssokolow ssokolow changed the title Make --binary optional Make --binary optional (<FILE> should be a positional argument) Oct 18, 2019
@ssokolow
Copy link
Author

ssokolow commented Oct 18, 2019

Actually, now that I think about it, I originally intended "make it optional" as a way to preserve API compatibility with scripts that call Rustig but, now, it occurs to me that an even more ideal interpretation would be to really make it optional and make it support multi-binary projects too.

rustig [FLAGS] [OPTIONS] [FILE] [...]

The best UX would be if you could just type rustig from within a project and have it figure out where main() is located automatically... maybe as a cargo panics command which also calls cargo build if necessary.

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

1 participant