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

Extensible CLI #241

Open
lthms opened this issue Dec 1, 2022 · 2 comments
Open

Extensible CLI #241

lthms opened this issue Dec 1, 2022 · 2 comments

Comments

@lthms
Copy link
Contributor

lthms commented Dec 1, 2022

Could it be possible to have a mechanism similar to the one git has, such that when stg does not know a command cmd, it tries to see if stg-cmd is available though PATH?

Use case: having a dedicated command for

stg push $(stg series -U | cut -c 3- | fzf)

I could make it a git subcommand, but having to use both git and stg is a bit cumbersome, so having to call stg through git can quickly give one a headache I’m afraid.

@jpgrayson
Copy link
Collaborator

This is an interesting idea, @lthms. I think it is worth looking into. My next step will be look at the mechanism git uses to do this and evaluate whether it is readily portable to StGit.

@lthms
Copy link
Contributor Author

lthms commented Dec 2, 2022

I had the opportunity to implement that once in clap and if I remember correctly, it was pretty straightforward. I can try to have a look this week-end.

allow_external_subcommands does most of the work

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

No branches or pull requests

2 participants