[darcs-users] [patch400] Add commandProgramName field to DarcsCommand

Joachim Breitner bugs at darcs.net
Fri Sep 17 08:10:40 UTC 2010


Joachim Breitner <mail at joachim-breitner.de> added the comment:

Hi,

Am Freitag, den 17.09.2010, 08:07 +0000 schrieb Eric Kow:
> Eric Kow <kowey at darcs.net> added the comment:
> 
> On Thu, Sep 16, 2010 at 18:11:17 +0000, Joachim Breitner wrote:
> >  subusage :: DarcsCommand -> String
> >  subusage super =
> >      (usageInfo
> > - -     ("Usage: darcs "++commandName super++" SUBCOMMAND ... " ++
> > +     ("Usage: " ++ commandProgramName super ++ " "++commandName super++" SUBCOMMAND ... " ++
> 
> Quick screening question.  Wouldn't it be simpler for subusage
> to have access to the result of System.Environment.getProgramName?

no, because
 a) It is in IO
 b) There might be reasons to toss around commands for other programs.
Assume you would, for some reason, have a suite of darcs related
programs, and want to generate manpages for all of them in one place.
Then being able to handle DarcsCommands of different executables would
help.

b) is quite hypothetical, but a) is a selling point IMHO :-)

Greetings,
Joachim

-- 
Joachim "nomeata" Breitner
  mail: mail at joachim-breitner.de | ICQ# 74513189 | GPG-Key: 4743206C
  JID: nomeata at joachim-breitner.de | http://www.joachim-breitner.de/
  Debian Developer: nomeata at debian.org

__________________________________
Darcs bug tracker <bugs at darcs.net>
<http://bugs.darcs.net/patch400>
__________________________________


More information about the darcs-users mailing list