darcs

Patch 991 avoid displaying 'Unknown ...' in the output of `darcs...

Title avoid displaying 'Unknown ...' in the output of `darcs...
Superseder Nosy List gpiero
Related Issues
Status accepted Assigned To
Milestone

Created on 2012-12-19.18:47:37 by gpiero, last changed 2012-12-21.16:45:50 by owst.

Files
File name Status Uploaded Type Edit Remove
avoid-displaying-_unknown-____-in-the-output-of-_darcs-help-environment_.dpatch gpiero, 2012-12-19.18:47:37 application/x-darcs-patch
patch-preview.txt gpiero, 2012-12-19.18:47:37 text/x-darcs-patch
See mailing list archives for discussion on individual patches.
Messages
msg16441 (view) Author: gpiero Date: 2012-12-19.18:47:37
Currently this is the output when looking for the help of, say, the $EMAIL var:

------
screened $ darcs help environment EMAIL
DARCS_EMAIL and EMAIL:
  Each patch is attributed to its author, usually by email address (for
  example, `Fred Bloggs <fred@example.net>`).  Darcs looks in several
  places for this author string: the `--author` option, the files
  `_darcs/prefs/author` (in the repository) and `~/.darcs/author` (in your
  home directory), and the environment variables `$DARCS_EMAIL` and
  `$EMAIL`.  If none of those exist, Darcs will prompt you for an author
  string and write it to `_darcs/prefs/author`.  Note that if if you have more
  than one email address, note that you can put them all in `~/.darcs/author`,
  one author per line.  Darcs will still prompt you for an author, but it
  allows you to select from the list, or to type in an alternative.

Unknown environment variables: 
screened $ 
------

Note the last line reading 'Unknown environment variables:'. This line is
handy when looking for help about a variable unknown by darcs:

------
screened $ darcs help environment EMAIL foo
DARCS_EMAIL and EMAIL:
[...]
Unknown environment variables: FOO
screened $ 
------

but seems a bit ugly when no "unknown" variable has actually been passed to the
command line.

The attached patch displays that last line only when it is actually needed.

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

Wed Dec 19 01:05:18 CET 2012  Gian Piero Carrubba <gpiero@rm-rf.it>
  * avoid displaying 'Unknown ...' in the output of `darcs help environment`
  when no unknown variable has been feeded.
Attachments
msg16464 (view) Author: owst Date: 2012-12-21.16:45:50
Thanks for this patch, I've accepted it, and have also pushed a
simplification/tidy-up followup.
History
Date User Action Args
2012-12-19 18:47:37gpierocreate
2012-12-21 16:45:50owstsetstatus: needs-screening -> accepted
messages: + msg16464