jj
jj copied to clipboard
cli: allow arg list in `ui.default-command`
Summary
Hello, I use ui.default-command
a lot, but I miss it having default arguments too.
Since ui.diff.tool
accepts both String
and Vec<String>
, I thought it wouldn't be a problem to implement it. If this is against any design consideration you all have, feel free to close it.
Thanks a lot for the CLI though, I've been enjoying it a lot over git
:blush:
Checklist
If applicable:
- [x] I have updated
CHANGELOG.md
- [x] I have updated the documentation (README.md, docs/, demos/)
- [x] I have updated the config schema (cli/src/config-schema.json)
- [ ] I have added tests to cover my changes
I'm not sure this is necessary
Hey, thanks for your PR!
I'm not sure this is necessary
FYI this is currently possible:
[ui]
default-command = "sl"
[aliases]
sl = ["log", "-r", "crit"]
Oh I see! it is just more indirect.
The necessary part was about the tests 😅
I would think this would also allow nice little variations like the following:
ui.default-command = ["foo", "-r", "::@"] aliases.foo = [ "log", "--reversed" ]
Which would expand to
jj log --reversed -r ::@
(I hope!)
This does work btw :)
Hi! I independently stumbled on this myself and wrote https://github.com/martinvonz/jj/pull/3195 without knowing this existed; are you still working on this? If so I'm happy to defer to you here, if not I can work on getting my own PR finalized instead.
Hey @torquestomp I ended up not continuing because of personal issues (moving, sickness etc) I'll only be able to come back to it in a month or two. Feel free to continue/finish the work :slightly_smiling_face:
Closing since #3195 was merged.