prasmussen / chrome-cli

Control Google Chrome from the command line
MIT License
2.61k stars 89 forks source link

support `-t` and `-w` options before required arguments? #76

Open lsloan opened 1 year ago

lsloan commented 1 year ago

To follow Unix/Linux CLI style a little more closely, could you add support for the options -t, -w, etc. to appear before the required positional arguments? That is, currently the open command only allows the -w option after the URL positional argument, like this…

chrome-cli open url -w id

It would be helpful, especially to users with years of Unix/Linux CLI experience, if the -w option would be allowed before the URL positional argument, like this…

chrome-cli open -w id url

And the same would apply to all other CLI options for all of the commands.

It could be implemented to allow the options before OR after the positional arguments, making it convenient and backwards compatible with the current syntax.

prasmussen commented 1 year ago

I totally agree with this. If I ever rewrite this tool in a more modern language I will use a proper args lib that can handle this.