Skip to content

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

Open

Description

@ssokolow

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.

Activity

  1. changed the title [-]Make --binary optional[/-] [+]Make --binary optional (<FILE> should be a positional argument)[/+] on Oct 18, 2019
  2. ssokolow commented on Oct 18, 2019

    @ssokolow
    Author

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions