From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: Zsh Users <zsh-users@zsh.org>
Cc: Leonardo dos Reis Gama <leonardo.reis.gama@gmail.com>
Subject: Re: Subcommand dispatcher and alias factory
Date: Mon, 3 Sep 2018 14:07:09 +0000 [thread overview]
Message-ID: <20180903140709.d5u6qvx63j6vi3nf@tarpaulin.shahaf.local2> (raw)
In-Reply-To: <CAH+w=7Y+zVuihV2+vvXSVBkBxak2SXS=-m1k4O7z9v-PrTE++w@mail.gmail.com>
Bart Schaefer wrote on Fri, Aug 31, 2018 at 16:01:25 -0700:
> the shell MUST first execute "git". Unless all commands with
> subcommands were to share some standard exit status or error message
> that would allow the shell to discover that the reason for failure was
> that the subcommand is not found, the shell has no generic way to know
> why the primary command failed in order to try it again differently.
> You can program it separately for each command that has subcommands,
> as was shown in examples in a couple of the links you mentioned.
>
I don't understand what's so bad about subcommands. What's different
between, say, «git ci -S foo» failing because 'git' doesn't know the
'ci' subcommand, and that command failing for any other business logic
reason (e.g., 'foo' being an invalid argument)?
> This, by the way, is why commands with subcommands are basically
> horrible, and a perversion of the UNIX command model. It's like
> creating a custom shell within the shell. Which latter is fine if you
> tell the user that's what you're doing (I was one of the major
> contributors to a custom shell for managing email, back in the day),
> but in the git-style incarnation always grates on me in the same way
> that layering violations in object-oriented programs do.
next prev parent reply other threads:[~2018-09-03 14:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-31 21:54 Leonardo dos Reis Gama
2018-08-31 23:01 ` Bart Schaefer
2018-09-03 14:07 ` Daniel Shahaf [this message]
2018-09-08 5:56 ` genelocated
2018-09-08 5:58 ` genelocated
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=20180903140709.d5u6qvx63j6vi3nf@tarpaulin.shahaf.local2 \
--to=d.s@daniel.shahaf.name \
--cc=leonardo.reis.gama@gmail.com \
--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).