From: Thomas Schwinge <thomas@schwinge.name>
To: david@tethera.net, notmuch@notmuchmail.org
Cc: David Bremner <bremner@debian.org>
Subject: Re: [PATCH] cli: change argument parsing convention for subcommands
Date: Sat, 22 Oct 2011 19:08:50 +0200 [thread overview]
Message-ID: <87sjmlgdi5.fsf@kepler.schwinge.homeip.net> (raw)
In-Reply-To: <1319199557-16888-1-git-send-email-david@tethera.net>
[-- Attachment #1: Type: text/plain, Size: 918 bytes --]
Hi!
On Fri, 21 Oct 2011 09:19:17 -0300, david@tethera.net wrote:
> previously we deleted the subcommand name from argv before passing to
> the subcommand. In this version, the deletion is done in the actual
> subcommands. Although this causes some duplication of code, it allows
> us to be more flexible about how we parse command line arguments in
> the subcommand, including possibly using off-the-shelf routines like
> getopt_long that expect the name of the command in argv[0].
Ack. Like when the C library startup passes control to the main
function, where argv[0] is the invoked executable.
It seems that notmuch.c:notmuch_help_command also needs to be adapted?
notmuch-setup.c:notmuch_setup_command does not need to be adapted (and
hasn't been) for it doesn't look at its argv. (It should bail out if
there are any arguments passed, but that's for another patch.)
Grüße,
Thomas
[-- Attachment #2: Type: application/pgp-signature, Size: 489 bytes --]
next prev parent reply other threads:[~2011-10-22 17:09 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-21 12:19 [PATCH] cli: change argument parsing convention for subcommands david
2011-10-21 17:20 ` Jameson Graef Rollins
2011-10-22 17:08 ` Thomas Schwinge [this message]
2011-10-22 23:47 ` David Bremner
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
List information: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87sjmlgdi5.fsf@kepler.schwinge.homeip.net \
--to=thomas@schwinge.name \
--cc=bremner@debian.org \
--cc=david@tethera.net \
--cc=notmuch@notmuchmail.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://yhetil.org/notmuch.git/
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 read-only IMAP folder(s) and NNTP newsgroup(s).