Closed fitzgen closed 8 years ago
Had to change the docopt usage string. Unsure if there is a better way.
I suppose another way would be to see if the first argument ends with "cargo-benchcmp" and the second argument is not "benchcmp" and then automatically insert "benchcmp" as the second argument.
I would prefer a method that doesn't change the usage string. I find the docs confusing without mentioning cargo
in there, given that the usage should be cargo benchcmp
or cargo-benchcmp
...
Ok, consider me blind. I missed your second comment completely. That way, adding in benchcmp
, sounds like a nicer approach to me.
@BurntSushi have an opinion about the above?
I'd like for the usage string to reflect how the user should use the tool, which is cargo benchcmp
. However, cargo-benchcmp
should also work. I think this means we should look at argv[0]
, and if it's basename is cargo-benchcmp
, insert benchcmp
at argv[1]
(and move all other arguments down). I think that solves this without changing the usage string, right?
I think this means we should look at argv[0], and if it's basename is cargo-benchcmp, insert benchcmp at argv[1](and move all other arguments down). I think that solves this without changing the usage string, right?
Yep, this is what I was trying to suggest as an alternative in https://github.com/BurntSushi/cargo-benchcmp/pull/21#issuecomment-251000816
I'll implement this and then comment again once I've updated the PR.
@BurntSushi I've force pushed a new version that adds "benchcmp" when invoked as "cargo-benchcmp" rather than removing "benchcmp" when invoked as "cargo benchcmp", which lets us keep the original USAGE
string.
Hmm... Looks like Windows build is failing, but it appears unrelated to this PR.
@fitzgen Thanks so much! :-)
Thank you!
My apologies, but I had to back this change out because of #26.
I'm not necessarily opposed to merging another fix for this, but I'll have to insist that it be well tested.
No problem -- not sure if this is really worth jumping through hoops for.
Fixes #20.
Had to change the docopt usage string. Unsure if there is a better way.