Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Subcommand dispatcher and alias factory
- X-seq: zsh-users 23604
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: Subcommand dispatcher and alias factory
- Date: Mon, 3 Sep 2018 14:07:09 +0000
- Cc: Leonardo dos Reis Gama <leonardo.reis.gama@xxxxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= daniel.shahaf.name; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=1MojDc M3LkckL5z4acc4BMmbU3/JLtRK/4ib1OCjHgM=; b=K+jNuUuNfPKdbaRJUWvZgf G0IYaBpcco0BEAhVvE1HwvOInfbiwnkQDwJ+MBaZ6ruTc9C36HPs+GxyhmXEob20 REVG8TCieNbXlFFwkov3D6pKFyfA2/GfKKjUihwaf3P6iSPuT49WFAuckG8Dz76W uOVetgGoJBVmj6HjHj+9eXJ8UudEQ0l6MiV+496hYRrRd1H8TThtGwghd0/W8/ZA bfObxmODbo1qGi0zDVlVZLBvgSpbR8XsLi+6QcGPQZT1GUwLoaapgDkFAblTdCaf QO1rYADodjFaQrR4rIjWBBguqm3+vnrb1cYizIiCpLwKzF8saTAPQO4/E7O5MnGQ ==
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=1MojDc M3LkckL5z4acc4BMmbU3/JLtRK/4ib1OCjHgM=; b=IJCxh2A+gb/yB2FZzqphK8 KEoIhlgiEX7KA2EdChpBb4tdfLXpg989s3M1FyOfbu6YsMfO+tSmBK6epITnv0MT 27mIVK2a4VB78mSXbojxDFYF8Y+NsXc/+68dfGdFQTgrVQ4F1E2Hl8kEN4zpSUpC knHTsH0sIoBzQ76B5L0uVycKrTznxuG/bu+VE1COsXc75BddmnJpqIFzRXGPqu+i VApu4dzB2TQac3w9SHgffHUvSEZXscyIPEegTF+WXV6zezC8+CeFpzZWTtLgFiVt tjNpvioxJwuyKWYZya0BNiMyYZNSe9PAB2jDt8WQh7iNhA3Lfil762NeHsbRHWKg ==
- In-reply-to: <CAH+w=7Y+zVuihV2+vvXSVBkBxak2SXS=-m1k4O7z9v-PrTE++w@mail.gmail.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CAAJJbEUL_PAN08p6fGKQEhajLGQkociru+UYvpV-7x+aN2uYxA@mail.gmail.com> <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.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author