darcs

Patch 302 Resolve issue1887: add a missing newline to --list-opt...

Title Resolve issue1887: add a missing newline to --list-opt...
Superseder Nosy List kowey, mornfall
Related Issues
Status accepted Assigned To
Milestone

Created on 2010-07-11.19:34:58 by mornfall, last changed 2011-05-10.21:36:34 by darcswatch. Tracked on DarcsWatch.

Files
File name Status Uploaded Type Edit Remove
resolve-issue1887_-add-a-missing-newline-to-__list_options-output_.dpatch mornfall, 2010-07-11.19:34:58 text/x-darcs-patch
unnamed mornfall, 2010-07-11.19:34:58
See mailing list archives for discussion on individual patches.
Messages
msg11717 (view) Author: mornfall Date: 2010-07-11.19:34:58
Should be self-explanatory.

1 patch for repository darcs-unstable@darcs.net:darcs:

Sun Jul 11 21:35:35 CEST 2010  Petr Rockai <me@mornfall.net>
  * Resolve issue1887: add a missing newline to --list-options output.
Attachments
msg11723 (view) Author: kowey Date: 2010-07-12.13:45:12
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.
msg11732 (view) Author: darcswatch Date: 2010-07-12.15:22:49
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-a09a7a50ccfd1e201c6b1a34ab159a96af8eb1f5
msg14358 (view) Author: darcswatch Date: 2011-05-10.21:36:34
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-a09a7a50ccfd1e201c6b1a34ab159a96af8eb1f5
History
Date User Action Args
2010-07-11 19:34:58mornfallcreate
2010-07-11 19:37:48darcswatchsetdarcswatchurl: http://darcswatch.nomeata.de/repo_http:__darcs.net_.html#bundle-a09a7a50ccfd1e201c6b1a34ab159a96af8eb1f5
2010-07-12 13:45:12koweysetnosy: + kowey
messages: + msg11723
2010-07-12 15:22:49darcswatchsetstatus: needs-review -> accepted
messages: + msg11732
2011-05-10 21:36:34darcswatchsetmessages: + msg14358