rustig icon indicating copy to clipboard operation
rustig copied to clipboard

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

Open ssokolow opened this issue 6 years ago • 1 comments

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 avatar Oct 18 '19 17:10 ssokolow

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.

ssokolow avatar Oct 18 '19 17:10 ssokolow