Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Feature request: a command launcher



On 18 Dec 2017 at 10:39:33, Sebastian Gniazdowski (psprint@xxxxxxxxxxx) wrote:
> I came up with this idea for Zplugin, but decided to ask in feature-request style, because  
> I really think that Zsh would gain from such feature. And I'm curious of possible code  
> and alterations. But I also need feedback if this looks useful or not.

Found other use-case:

- 'zplugin self-update' downloads new *zplugin* commits and *doesn't* list them like in case of updating a plugin
- the goal: list new zplugin commits, then merge
- the created service is to be named 'self-update'
- user is to run: 'zplugin run self-update', not 'zplugin self-update'
- definition of the service could look like this:

    integer disabled=0
    local command="git fetch; git log ..FETCH_HEAD; zplugin self-update"
    local arguments=";--oneline;"
    local spawn_type=";;"  # default, via eval, no forking, etc.
    local run_method="command;command;function"
    local work_dir="${ZPLGM[BIN_DIR]}"  # zplugin fills this
    integer cd=0  # don't stay in zplugin's directory, go back

I skipped redirections, environment, sudo, etc., those fields should be empty.

I could even ship this service with zplugin. For me, when I compare shipping a script (like say self-update.zsh) vs. shipping a definition, it's clear that the script route gives impression like if user should run someone's joyful creativity done during a single weekend and this is very repulsive. I think the amount of attention given to contributed or helper scripts is low in great majority of projects, and users may think the same.

The service definition route, on the other hand, seems to be very solid. Altering the definition doesn't give impression that a mistake can easily be made. It looks like zplugin has a sharp subsystem that allows to be driven by a few assignments. There are not many points of freedom, and the subsystem is expected to be bug-free, maintained.

--  
Sebastian Gniazdowski
psprint /at/ zdharma.org



Messages sorted by: Reverse Date, Date, Thread, Author