hulu / roku-dev-cli

A command-line developer tool for loading Roku builds
Apache License 2.0
26 stars 8 forks source link

Support --options with hyphens #13

Closed jwfearn closed 5 years ago

jwfearn commented 5 years ago

Motivation: hyphens are faster to type, since they don't require a modifier key like underscore does. In my experience hyphens are more widely used. I looked at the man pages for some common command line utilities (curl, wget, node, git, zip, grep, bash) and hyphen spelling is more common.

We have a number of double-dash long options which are currently spelled with underscores. For example:

$ roku --check_ip $ROKU_DEV_TARGET
$ roku --zip_file my.zip

This PR adds support for spelling them with hyphens while maintaining the underscore spellings for backwards compatibility. So the above style still works as well as hyphen-style:

$ roku --check-ip $ROKU_DEV_TARGET
$ roku --zip-file my.zip

Also, the help message lists the hyphen-spelled versions and omits the underscore_spelled versions to reduce the amount of help text.

jwfearn commented 5 years ago

@sjbarag, I update the PR description above to add a motivation explanation.

sjbarag commented 5 years ago

@sjbarag, I update the PR description above to add a motivation explanation.

Thanks!