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