From: Junio C Hamano <gitster@pobox.com>
To: "Imran M Yousuf" <imyousuf@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] - Updated usage and simplified sub-command action invocation
Date: Fri, 11 Jan 2008 17:38:57 -0800 [thread overview]
Message-ID: <7vk5mfzutq.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <7bfdc29a0801092341j60dcb081xe4bf6c22cbaf30f2@mail.gmail.com> (Imran M. Yousuf's message of "Thu, 10 Jan 2008 13:41:08 +0600")
"Imran M Yousuf" <imyousuf@gmail.com> writes:
>> > Actually module_$command is not possible because only add's module is
>> > module_add rest are modules_$command....
>>
>> Is there a fundamental reason why you cannot rename them to be
>> more consistent?
>
> In fact it is consistent, add works on a single module only, whereas
> rest of the command works either on 1 or more. Thus having plural
> (modules) is logical.
It certainly is consistent in _that_ meaning of the word, but I
was not talking about that consistency, which is less useful in
this context.
The consistency I was talking about was "A subcommand called $foo
is always handled by a shell function called cmd_$foo". That is
also a consistency, and it is of much more useful kind in a
situation like this, namely, a command dispatcher.
If you have show_blobs() and show_commit() subroutines, former
of which takes 1 or more blobs while the latter of which can
only take 1 commit, being consistent in your meaning might help
the programmers avoiding a mistake to pass two or more commits
to a non-existent show_commits(). In that sense, your kind of
consistency is not totally useless.
However, it is not so useful in a context where there is one
call site for each of the functions, like a command dispatcher
scenario.
next prev parent reply other threads:[~2008-01-12 1:39 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-10 4:07 [PATCH] - Updated usage and simplified sub-command action invocation imyousuf
2008-01-10 6:23 ` Junio C Hamano
2008-01-10 6:51 ` Imran M Yousuf
2008-01-10 7:22 ` Junio C Hamano
2008-01-10 7:41 ` Imran M Yousuf
2008-01-12 1:38 ` Junio C Hamano [this message]
2008-01-11 9:09 ` Imran M Yousuf
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=7vk5mfzutq.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=imyousuf@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).