zsh-users
 help / color / mirror / code / Atom feed
From: Sebastian Gniazdowski <psprint@zdharma.org>
To: Zsh Users <zsh-users@zsh.org>
Subject: Re: Feature request: a command launcher
Date: Mon, 18 Dec 2017 15:57:58 +0100	[thread overview]
Message-ID: <etPan.5a37d777.208156ef.19e@zdharma.org> (raw)
In-Reply-To: <etPan.5a378cd5.756ab874.19e@zdharma.org>

On 18 Dec 2017 at 10:39:33, Sebastian Gniazdowski (psprint@zdharma.org) 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


      reply	other threads:[~2017-12-18 14:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-18  9:39 Sebastian Gniazdowski
2017-12-18 14:57 ` Sebastian Gniazdowski [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=etPan.5a37d777.208156ef.19e@zdharma.org \
    --to=psprint@zdharma.org \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).