git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Narebski <jnareb@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Ramkumar Ramachandra <artagnon@gmail.com>,
	Jonathan Nieder <jrnieder@gmail.com>,
	Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>,
	Git List <git@vger.kernel.org>
Subject: Re: [PATCH 2/2] bundle: rewrite builtin to use parse-options
Date: Fri, 09 Dec 2011 05:33:18 -0800 (PST)	[thread overview]
Message-ID: <m34nx9j2fc.fsf@localhost.localdomain> (raw)
In-Reply-To: <7viplqhbgs.fsf@alter.siamese.dyndns.org>

Junio C Hamano <gitster@pobox.com> writes:

> Ramkumar Ramachandra <artagnon@gmail.com> writes:
> 
> > That being said, do you see value in lifting the restriction on
> > opts->long_name and PARSE_OPTS_NODASH not allowed together?  The
> > restriction seems quite arbitrary, but I can't justify lifting it
> > unless I can show some valid usecase.
> 
> True and true.
> 
> As to the first "true", it is because the nodash was introduced only to
> parse "find ... \( ... \)" style parentheses as if they are part of option
> sequence, and that use case only needed a single letter.
> 
> As to the second "true", it is because so far we didn't need anything
> longer.
> 
> I do not think the name of a subcommand is not a good use case example for
> it, by the way. Unlike parentheses on the command line of "find" that can
> come anywhere and there can be more than one, the subcommand must be the
> first thing on the command line and only one subcommand is given at one
> command invocation.

Well, I think it doesn't have to be true: there can be some options
like e.g. '-n' / '--dry-run' that are common to all subcommands, and
in my opinion they could come before subcommand name.

But if restriction that subcommand name must be first simplifies code,
then let's do it this way.


I agree that subcommands are and must be mutually exclusive --
otherwise they better be implemented as options, not subcommands.

-- 
Jakub Narębski

  reply	other threads:[~2011-12-09 13:33 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-08 13:10 [PATCH v2 0/6] Fix '&&' chaining in tests Ramkumar Ramachandra
2011-12-08 13:10 ` [PATCH 1/2] parse-options: introduce OPT_SUBCOMMAND Ramkumar Ramachandra
2011-12-08 16:30   ` Jonathan Nieder
2011-12-08 16:43     ` Ramkumar Ramachandra
2011-12-08 13:10 ` [PATCH 1/6] t3040 (subprojects-basic): modernize style Ramkumar Ramachandra
2011-12-08 16:34   ` Jonathan Nieder
2011-12-09  7:56     ` Ramkumar Ramachandra
2011-12-09 18:26       ` Junio C Hamano
2011-12-09 18:32         ` Ramkumar Ramachandra
2011-12-08 13:10 ` [PATCH 2/2] bundle: rewrite builtin to use parse-options Ramkumar Ramachandra
2011-12-08 16:39   ` Jonathan Nieder
2011-12-08 16:47     ` Ramkumar Ramachandra
2011-12-08 17:03       ` Jonathan Nieder
2011-12-08 17:38         ` Ramkumar Ramachandra
2011-12-08 17:59           ` Jonathan Nieder
2011-12-08 19:39             ` Ramkumar Ramachandra
2011-12-08 23:48               ` Junio C Hamano
2011-12-09 13:33                 ` Jakub Narebski [this message]
2011-12-09 18:24                   ` Junio C Hamano
2011-12-15 16:45             ` [PATCH 0/2] Improve git-bundle builtin Ramkumar Ramachandra
2011-12-15 16:45               ` [PATCH 1/2] t5704 (bundle): rewrite for larger coverage Ramkumar Ramachandra
2011-12-15 21:16                 ` Jonathan Nieder
2011-12-15 16:45               ` [PATCH 2/2] bundle: rewrite builtin to use parse-options Ramkumar Ramachandra
2011-12-15 21:29                 ` Jonathan Nieder
2011-12-15 20:54               ` [PATCH 0/2] Improve git-bundle builtin Jonathan Nieder
2011-12-15 21:30               ` Junio C Hamano
2011-12-08 13:10 ` [PATCH 2/6] t3030 (merge-recursive): use test_expect_code Ramkumar Ramachandra
2011-12-08 13:10 ` [PATCH 3/6] t1006 (cat-file): use test_cmp Ramkumar Ramachandra
2011-12-08 13:28   ` Matthieu Moy
2011-12-08 13:33     ` Ramkumar Ramachandra
2011-12-08 13:41       ` Matthieu Moy
2011-12-08 16:55   ` Jonathan Nieder
2011-12-08 13:10 ` [PATCH 4/6] t3200 (branch): fix '&&' chaining Ramkumar Ramachandra
2011-12-08 17:07   ` Jonathan Nieder
2011-12-08 13:10 ` [PATCH 5/6] t1510 (worktree): " Ramkumar Ramachandra
2011-12-08 17:12   ` Jonathan Nieder
2011-12-09  0:00     ` Junio C Hamano
2011-12-08 13:10 ` [PATCH 6/6] test: " Ramkumar Ramachandra
2011-12-08 17:18   ` Jonathan Nieder
2011-12-08 19:55 ` [PATCH v2 0/6] Fix '&&' chaining in tests Junio C Hamano
2011-12-09  5:23   ` Ramkumar Ramachandra
2011-12-09 11:29 ` [PATCH v3 " Ramkumar Ramachandra
2011-12-09 11:29   ` [PATCH 1/6] t3040 (subprojects-basic): fix '&&' chaining, modernize style Ramkumar Ramachandra
2011-12-09 11:29   ` [PATCH 2/6] t3030 (merge-recursive): use test_expect_code Ramkumar Ramachandra
2011-12-09 11:29   ` [PATCH 3/6] t1006 (cat-file): use test_cmp Ramkumar Ramachandra
2011-12-09 18:43     ` Junio C Hamano
2011-12-09 18:47       ` Ramkumar Ramachandra
2011-12-09 11:29   ` [PATCH 4/6] t3200 (branch): fix '&&' chaining Ramkumar Ramachandra
2011-12-09 11:29   ` [PATCH 5/6] t1510 (worktree): " Ramkumar Ramachandra
2011-12-09 11:29   ` [PATCH 6/6] tests: " Ramkumar Ramachandra
  -- strict thread matches above, loose matches on Subject: below --
2011-12-08 12:07 [PATCH 0/2] Parsing a subcommand using parse-options Ramkumar Ramachandra
2011-12-08 12:07 ` [PATCH 2/2] bundle: rewrite builtin to use parse-options Ramkumar Ramachandra

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=m34nx9j2fc.fsf@localhost.localdomain \
    --to=jnareb@gmail.com \
    --cc=Matthieu.Moy@grenoble-inp.fr \
    --cc=artagnon@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jrnieder@gmail.com \
    /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.
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).