On Sun, Jul 11, 2010 at 19:34:58 +0000, Petr Ročkai wrote:
> Sun Jul 11 21:35:35 CEST 2010 Petr Rockai <me@mornfall.net>
> * Resolve issue1887: add a missing newline to --list-options output.
I've nominated issue1887 for Darcs 2.5 and will push it to that branch
too.
Resolve issue1887: add a missing newline to --list-options output.
------------------------------------------------------------------
> Petr Rockai <me@mornfall.net>**20100711193535
> Ignore-this: 912b18e8f89be19d186332f5f98a8083
> ] hunk ./src/Darcs/RunCommand.hs 91
> setProgressMode False
> commandPrereq cmd opts
> file_args <- commandGetArgPossibilities cmd
> - putStrLn $ getOptionsOptions (opts1++opts2) ++ unlines file_args
> + putStrLn $ unlines $ getOptionsOptions (opts1++opts2) : file_args
This looks like it fixes a regression introduced by my patch
Resolve issue1741: fix --list-options when option has multiple names.
hunk ./src/Darcs/RunCommand.hs 154
-get_options_options [] = ""
-get_options_options (o:os) =
- get_long_option o ++"\n"++ get_options_options os
- get_long_option (Option a os b c)
+get_options_options = concat . intersperse "\n" . concatMap goo
+ where
+ goo (Option _ os _ _) = map ("--"++) os
I'm not paying enough attention to be sure, but it looks like I really wanted
unlines and not concat . intersperse "\n" (ie. that the empty list was what was
providing the final newline). In my (very meagre) defense, this is why you
typically want higher order functions instead of explicit traversal.
--
Eric Kow <http://www.nltg.brighton.ac.uk/home/Eric.Kow>
For a faster response, please try +44 (0)1273 64 2905.
|