Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cli: complete: complete -T template aliases #5541

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

jakobhellermann
Copy link
Contributor

@jakobhellermann jakobhellermann commented Jan 31, 2025

based on #5539

image

It would be nice to filter them down to only applicable ones, but I don't think that type information is present in the toml definitions.

Checklist

If applicable:

  • I have updated CHANGELOG.md
  • I have updated the documentation (README.md, docs/, demos/)
  • I have updated the config schema (cli/src/config-schema.json)
  • I have added tests to cover my changes

E.g. when the user doesn't have the default command set, you don't want
to get
```
Warning: Cannot define an alias that overrides the built-in command 'log'
```
printed on every completion.
@jakobhellermann
Copy link
Contributor Author

We could also emit a description for the template, but it would only have room for one line, and I don't think that provides much value.

image

I suppose another option would be only to display the help text for one-line templates, which is better, but probably not worth the visual clutter over the simple horizontal list of all templates.

image

@ilyagr
Copy link
Contributor

ilyagr commented Feb 1, 2025

I'm not sure how major this is, but these suggestions include things like jj log -T builtin_op_log_compact that result in an error.

A hacky and impefect solution might be to filter the log templates by the regex ^builtin_log.

I wonder if we could/should reorganize templates by the kind of object they take, so that this would be op_log.builtin_compact. This might be a bit of a project, it would also raise the questions of what to do about template aliases, and whether that should be referred to as jj op log -T op_log.builtin_compact or whether jj op log should assume the op_log. prefix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants