[darcs-users] [patch324] Make Darcs.RunCommand independent of Darcs.Commands.Help
Eric Kow
kowey at darcs.net
Tue Aug 3 17:12:30 UTC 2010
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 at 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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.osuosl.org/pipermail/darcs-users/attachments/20100803/19edbb87/attachment-0001.pgp>
More information about the darcs-users
mailing list