Support "--" in taylor cli to disambiguate arguments for taylor versus arguments for the game#78
Conversation
| Taylor::Commands::Squash.call(ARGV[1..], options) | ||
|
|
||
| when "--version" | ||
| when "--version", "-v" |
There was a problem hiding this comment.
Oh I threw this in here because I kept finding myself typing taylor -v and then having to do taylor --version but I probably should have thrown it in that other misc PR
There was a problem hiding this comment.
I did make a decision when I wrote all these commands to not support short flags as I think they're a bit confusing and by not having them I force people to write easy to understand commands. Please remove this short flag
There was a problem hiding this comment.
The current codebase/tool communicates and implements the exact opposite decision.
Are you sure you want me to remove this? It will make the help output a lie again and will make --version the inconsistent oddball again.
I can remove it, of course, but seems incorrect unless the intent is to implement that decision for the other 3 options and to fix the help output. I can also say as one using it that I type taylor -v by habit semi-frequently so there's a bit of an ergonomic loss as well.
There was a problem hiding this comment.
oh shoot, you're right. I think I considered not having short flags but didn't end up doing it. I've just been typing out the long flags for so long I forgot the short ones existed 😆
|
I'd prefer not to include the refactor in this pull request as I feel it makes it quite hard to read. I also would prefer not to have the refactor. It's a bit confusing but I think it's more legible to me as it is. The rest of the code looks pretty good to me and I think I'm happy to merge after you action these things. |
|
Oh, could you also please use the pull request template going forward? It helps me know what actions you've taken to ensure code quality |
I've gone ahead and put the PR description into the template format if helpful. |
Ah, that kind of surprises me. I think what I'll do is just move that commit to a different PR for re-consideration and I can point out why I think it reduces confusion instead of increasing confusion. I think that can be gleaned by reading the two commits in isolation but maybe easier as a separate PR. Then you can just close that PR if you still feel the same way. I've converted this to a draft and will do that likely later today. I'll update the PR description once done (and I'll add a changelog entry) and then I'll convert it back from a draft. I think I'll also move the Cheers! |
|
Alrighty I've moved the controversial parts to other PRs (the Unless you reviewed the previous two commits in isolation you should probably re-review. I also added an entry to the changelog. |
What's the Change?
Before I had to do:
taylor game.rb localhost(not a big deal)But now I can do
taylor -- localhostto pass localhost through to my game. Which feels more intuitive.Note, I also did a follow-up opportunistic refactor commit to get rid of the seemingly-unnecessary/confusing "command" parameter to
Run. You can review the commits separately if you don't like the refactor or also I'm happy to tweak stuff based on feedback.I also streamed working on this so I have video of the whole thing, ha. It's 4 hours total though. But if curious to click around in it I can share!
Checklist
Added tests
Added documentation
^ I suppose I could update the help output to mention this feature. Let me know if I should.
Updated
migrations/0_4_to_0_5.mdif it's a breaking change^ This one is likely irrelevant
Added an entry to
changelog.mdRe:
dx/exec bundle exec rake cirake ci:testingpasses and I added a couple tests for this. I can't get a passingrake cidue to clang-format errors. My clang-format version is 19.1.7.I also ran
raketo build taylor and tested it with~/gitlocal/ruby/Taylor/dist/linux/debug/taylor ~/gitlocal/ruby/Taylor/cli-tool/cli.rb -- localhostto verify it works.Running
dx/exec bundle exec rake cilike in the template item gave me the following error:Likely I'm missing some basic step to get that thing running first? This isn't related to my change. I assumed that a local
rake ci:testingwas probably good enough for a change like this but let me know.