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

suggestion for renaming commands via cfg file #198

Closed
wants to merge 3 commits into from

Conversation

PedroLopes
Copy link

dear @ginatrapani , your tool is amazing and I use it everyday. I've done a few mods, check if this one is interesting for you (take it as a suggestion, there are many ways to achieve this): this allows to rename commands via the config file, rather than having the user changing the code. Given that some of my friends use your script and are not programmers I made this for them to be able to change it easily.

anyway, ignore if not interesting, and thanks again for a wonderful tool!

@karbassi karbassi added this to the Version 2.12.0 milestone Mar 26, 2018
@karbassi
Copy link
Member

@inkarkat @evanp Could this be done via an addon?

@inkarkat
Copy link
Member

You can easily add aliases for existing commands (or third-party add-ons) via a small wrapper add-on, like my lspri alias here (which forwards to the built-in listpri / lsp command).

This is a separate file with 3 lines of code vs. a single-line configuration, but I would still prefer this because:

  • The original commands (that many add-ons rely on) are still available. With the proposed approach, add-ons would have to be adapted to use the introduced variables, too.
  • You can similarly wrap add-ons (cp. here), whereas the proposed approach does not handle this (as add-ons are looked up by script name, and todo.sh cannot know the used add-ons in advance).
  • The proposed approach would make some sense for a complete renaming of all actions, e.g. as part of a localization; however, for that it's incomplete (messages and errors are still English-only), and the add-on compatibility (see above) would not be addressed.
  • The existing configuration code already is long and messy; I'm not sure we want to complicate this further for a feature with little benefit and where alternatives exist.
  • The patch is incomplete because it does not adapt todo_completion.

@karbassi
Copy link
Member

Closing this for now.

If anyone wants to comment on a more feature-complete idea, we're open to it! 😄

@karbassi karbassi closed this Mar 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants