darcs

Patch 400 Add commandProgramName field to DarcsCommand

Title Add commandProgramName field to DarcsCommand
Superseder Nosy List nomeata, tux_rocker
Related Issues
Status accepted Assigned To
Milestone 2.5.1

Created on 2010-09-16.18:11:17 by nomeata, last changed 2011-05-10.19:38:19 by darcswatch. Tracked on DarcsWatch.

Files
File name Status Uploaded Type Edit Remove
add-commandprogramname-field-to-darcscommand.dpatch nomeata, 2010-09-16.18:11:17 text/x-darcs-patch
unnamed nomeata, 2010-09-16.18:11:17
See mailing list archives for discussion on individual patches.
Messages
msg12574 (view) Author: nomeata Date: 2010-09-16.18:11:17
Hi,

1 patch for repository http://darcs.net/releases/branch-2.5:

this is another patch that has on effect on the user interface of darcs, but
makes the DarcsLib API more useful.

Again, I’d be grateful if this would make it into 2.5, or at least one of the
point releases following 2.5.

Thanks,
Joachim

PS: I took the liberty to import DarcsCommand(..) everywhere, even when before
the field accessors were named explicitly. The (..)-variant was far more
common, so this is more consistent.


Thu Sep 16 20:06:43 CEST 2010  Joachim Breitner <mail@joachim-breitner.de>
  * Add commandProgramName field to DarcsCommand
  In order to make the command handling more generic, the name of the program
  (the executable) is now a field of DarcsCommand. It is used by the functions
  which generate the help output.
Attachments
msg12575 (view) Author: kowey Date: 2010-09-17.08:07:55
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?

-- 
Eric Kow <http://www.nltg.brighton.ac.uk/home/Eric.Kow>
For a faster response, try +44 (0)1273 64 2905 or
xmpp:kowey@jabber.fr (Jabber or Google Talk only)
msg12576 (view) Author: nomeata Date: 2010-09-17.08:10:39
Hi,

Am Freitag, den 17.09.2010, 08:07 +0000 schrieb Eric Kow:
> Eric Kow <kowey@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@joachim-breitner.de | ICQ# 74513189 | GPG-Key: 4743206C
  JID: nomeata@joachim-breitner.de | http://www.joachim-breitner.de/
  Debian Developer: nomeata@debian.org
msg12598 (view) Author: kowey Date: 2010-09-22.10:14:18
On Fri, Sep 17, 2010 at 08:10:40 +0000, Joachim Breitner wrote:
> > 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

I was going to say "what if it accepted just a String argument?"
but I imagine you already thought of that and decided that there
are uses of subusage which are far enough from IO that feeding it
getProgramName would be problematic.

>  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.

Not particularly convinced, but I'm going to accept this patch anyway.

Thanks!

-- 
Eric Kow <http://www.nltg.brighton.ac.uk/home/Eric.Kow>
For a faster response, try +44 (0)1273 64 2905 or
xmpp:kowey@jabber.fr (Jabber or Google Talk only)
msg12600 (view) Author: darcswatch Date: 2010-09-22.14:22:28
This patch bundle (with 1 patches) was just applied to the repository http://darcs.net/.
This message was brought to you by DarcsWatch
http://darcswatch.nomeata.de/repo_http:__darcs.net_.html#bundle-2d29156bd236cf67bf0d913876de4abc0ca26d1f
msg12614 (view) Author: ganesh Date: 2010-09-27.17:34:09
Reinier, is it ok for this to go into 2.5? I know it's against the strict 
policy but it does seem like a small change that'd be quite valuable.
msg12699 (view) Author: tux_rocker Date: 2010-10-15.14:25:14
It's not in darcs 2.5 RC 1 because I can't see in an instant that it's
completely innocent. But it can go into a 2.5.1 of course.
msg14227 (view) Author: darcswatch Date: 2011-05-10.19:38:19
This patch bundle (with 1 patches) was just applied to the repository http://darcs.net/reviewed.
This message was brought to you by DarcsWatch
http://darcswatch.nomeata.de/repo_http:__darcs.net_reviewed.html#bundle-2d29156bd236cf67bf0d913876de4abc0ca26d1f
History
Date User Action Args
2010-09-16 18:11:17nomeatacreate
2010-09-16 18:11:55darcswatchsetdarcswatchurl: http://darcswatch.nomeata.de/repo_http:__darcs.net_.html#bundle-2d29156bd236cf67bf0d913876de4abc0ca26d1f
2010-09-17 08:07:55koweysetmessages: + msg12575
2010-09-17 08:10:39nomeatasetmessages: + msg12576
2010-09-22 10:14:18koweysetmessages: + msg12598
2010-09-22 14:22:28darcswatchsetstatus: needs-screening -> accepted
messages: + msg12600
2010-09-27 17:34:10ganeshsetnosy: + tux_rocker
messages: + msg12614
2010-10-15 14:25:14tux_rockersetmessages: + msg12699
2010-11-26 00:19:05ganeshsetmilestone: 2.5.0
2011-01-01 17:28:12ganeshsetmilestone: 2.5.0 -> 2.5.1
2011-05-10 19:38:19darcswatchsetmessages: + msg14227