Re: [Haskell-cafe] Re: Re: A question regarding cmdargs package

2010-10-13 Thread Henning Thielemann
Ben Franksen schrieb:
 Neil Mitchell wrote:
 This makes me curious.  What's the use case where you want to allow the
 user to pass arguments on the command line, but you don't want that user
 to be able
 to use '--help' to find out what arguments may be passed?
 
 I wanted to create a clone of an existing program that had no help option
 and instead gave the help output if it saw an invalid option.

I find it very annoying if a program floods my terminal with a help
page, when I just misspelled something. A short descriptive message that
points to the mistake would be of more help for me.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: Re: A question regarding cmdargs package

2010-10-13 Thread Brandon S Allbery KF8NH
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 10/13/10 06:07 , Henning Thielemann wrote:
 Ben Franksen schrieb:
 I wanted to create a clone of an existing program that had no help option
 and instead gave the help output if it saw an invalid option.
 
 I find it very annoying if a program floods my terminal with a help
 page, when I just misspelled something. A short descriptive message that
 points to the mistake would be of more help for me.

He mentioned that he has backward compatibility constraints.  In an ideal
world

- -- 
brandon s. allbery [linux,solaris,freebsd,perl]  allb...@kf8nh.com
system administrator  [openafs,heimdal,too many hats]  allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon university  KF8NH
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.10 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAky1xmUACgkQIn7hlCsL25WWpwCdFM209D0Y0FfhBwgeOnfyuzJa
SoYAnAhNuo1uhFE6hNErRG8QdIPmQmB6
=XTVN
-END PGP SIGNATURE-
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Re: Re: A question regarding cmdargs package

2010-10-12 Thread Ben Franksen
Neil Mitchell wrote:
 This makes me curious.  What's the use case where you want to allow the
 user to pass arguments on the command line, but you don't want that user
 to be able
 to use '--help' to find out what arguments may be passed?

I wanted to create a clone of an existing program that had no help option
and instead gave the help output if it saw an invalid option.

 When you don't want to bother defining the help options/descriptions? :p

 (alternatively, you may wish to provide a more full-featured version
 like what darcs does by using a pager)
 
 You can already do this with CmdArgs. If you use cmdArgsMode/process
 it returns a structure populated to say what to do next (i.e. display
 a help message), but you are welcome to do something different, or do
 what it says in a different way. However, I can see some people might
 want to remove help entirely, so I'll try and find a balance.

The point here was not so much removing --help, but rather that I want to
have control over the 'standard' options (help,version,verbosity) in the
same way as for the rest. My program might not have a version, so why
offer --version? Or maybe I want a different name for it because the -V is
already used for something else, which I cannot change for backwards
compatibility. I might want another name for --help, for instance -h. The
standard -? does not work in all shells/configurations and --help might
look strange if all other options are of the one-dash-one-character sort. I
would also like to configure the help text for the standard options, for
instance for i18n or because I like starting with a lower case letter or...

Cheers
Ben

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Re: Re: A question regarding cmdargs package

2010-10-12 Thread Ben Franksen
Joachim Breitner wrote:
 Am Dienstag, den 12.10.2010, 16:42 +1100 schrieb Ivan Lazar Miljenovic:
 On 12 October 2010 16:32, Magnus Therning mag...@therning.org wrote:
 
  This makes me curious.  What's the use case where you want to allow the
  user to pass arguments on the command line, but you don't want that
  user to be able
  to use '--help' to find out what arguments may be passed?
 
 When you don't want to bother defining the help options/descriptions? :p
 
 note that people expect cmd --help to at least do nothing. So if your
 program is called launchMissiles, please make it at least spit out a
 message like your evil dictator was too lazy to write a help message
 when it is called with --help.
 
 (That is if you are sharing your program. Not sure if you should share
 launchMissiles at all.)

launchMissiles = putStrLn Boom! (just kidding :)

BTW another cool feature of an auto-magic option parsing lib is the GNU
standard -- (arguments after this are not to be treated as options).

Cheers
Ben

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: Re: A question regarding cmdargs package

2010-10-12 Thread Neil Mitchell
 The point here was not so much removing --help, but rather that I want to
 have control over the 'standard' options (help,version,verbosity) in the
 same way as for the rest. My program might not have a version, so why
 offer --version? Or maybe I want a different name for it because the -V is
 already used for something else, which I cannot change for backwards
 compatibility. I might want another name for --help, for instance -h. The
 standard -? does not work in all shells/configurations and --help might
 look strange if all other options are of the one-dash-one-character sort. I
 would also like to configure the help text for the standard options, for
 instance for i18n or because I like starting with a lower case letter or...

That i18n is a fantastic argument - and one that really means cmdargs
has no choice but to support all the attributes on help/version.

 BTW another cool feature of an auto-magic option parsing lib is the GNU
 standard -- (arguments after this are not to be treated as options).

cmdargs also supports this by default.

Thanks, Neil
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe