darcs

Patch 324 Make Darcs.RunCommand independent of Darcs.Commands.Help

Title Make Darcs.RunCommand independent of Darcs.Commands.Help
Superseder Nosy List kowey, nomeata
Related Issues
Status accepted Assigned To
Milestone

Created on 2010-08-03.16:57:56 by nomeata, last changed 2011-05-10.21:36:06 by darcswatch. Tracked on DarcsWatch.

Files
File name Status Uploaded Type Edit Remove
make-darcs_runcommand-independent-of-darcs_commands_help.dpatch nomeata, 2010-08-03.16:57:56 text/x-darcs-patch
unnamed nomeata, 2010-08-03.16:57:56
See mailing list archives for discussion on individual patches.
Messages
msg11927 (view) Author: nomeata Date: 2010-08-03.16:57:56
Hi,

while working on ipatch (interactive patch editor), I found this change useful. Should have no effect on darcs whatsoever.

Greetings,
Joachim

1 patch for repository http://darcs.net:

Tue Aug  3 18:59:17 CEST 2010  Joachim Breitner <mail@joachim-breitner.de>
  * Make Darcs.RunCommand independent of Darcs.Commands.Help
  by passing commandControlList via main.hs. This allows re-use of
  Darcs.RunCommand by other binaries with a different set of commands.
Attachments
msg11929 (view) Author: kowey Date: 2010-08-03.17:09:30
On Tue, Aug 03, 2010 at 16:57:56 +0000, Joachim Breitner wrote:
> while working on ipatch (interactive patch editor), I found this
> change useful. Should have no effect on darcs whatsoever.

This could spell an interesting direction for Darcs to take.
Use darcs technology to solve problems for non-darcs users without
making them use Darcs proper.

> Tue Aug  3 18:59:17 CEST 2010  Joachim Breitner <mail@joachim-breitner.de>
>   * Make Darcs.RunCommand independent of Darcs.Commands.Help
>   by passing commandControlList via main.hs. This allows re-use of

Applied, thanks! Grow, ecosystem, grow!

Make Darcs.RunCommand independent of Darcs.Commands.Help
--------------------------------------------------------
> - -runTheCommand :: String -> [String] -> IO ()
> - -runTheCommand cmd args =
> +runTheCommand :: [CommandControl] -> String -> [String] -> IO ()
> +runTheCommand commandControlList cmd args =
>    either fail rtc $ disambiguateCommands commandControlList cmd args
>   where
>    rtc (CommandOnly c, as)       = runCommand Nothing c  as

> - -import Darcs.Commands.Help ( helpCmd, listAvailableCommands, printVersion )
> +import Darcs.Commands.Help ( helpCmd, listAvailableCommands, printVersion, commandControlList )

>        hSetBinaryMode stdin True
>        hSetBinaryMode stdout True
> - -      runTheCommand (head argv) (tail argv)
> +      runTheCommand commandControlList (head argv) (tail argv)

-- 
Eric Kow <http://www.nltg.brighton.ac.uk/home/Eric.Kow>
For a faster response, please try +44 (0)1273 64 2905.
msg11933 (view) Author: darcswatch Date: 2010-08-03.17:29:37
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-0285571a725b708c690571ca3d591e98869de486
msg14346 (view) Author: darcswatch Date: 2011-05-10.21:36:06
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-0285571a725b708c690571ca3d591e98869de486
History
Date User Action Args
2010-08-03 16:57:56nomeatacreate
2010-08-03 16:58:35darcswatchsetdarcswatchurl: http://darcswatch.nomeata.de/repo_http:__darcs.net_.html#bundle-0285571a725b708c690571ca3d591e98869de486
2010-08-03 17:09:30koweysetnosy: + kowey
messages: + msg11929
2010-08-03 17:29:37darcswatchsetstatus: needs-review -> accepted
messages: + msg11933
2011-05-10 21:36:06darcswatchsetmessages: + msg14346