stgit icon indicating copy to clipboard operation
stgit copied to clipboard

Extensible CLI

Open lthms opened this issue 3 years ago • 2 comments

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.

lthms avatar Dec 01 '22 10:12 lthms

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.

jpgrayson avatar Dec 02 '22 01:12 jpgrayson

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

lthms avatar Dec 02 '22 07:12 lthms