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

2010-10-12 Thread Neil Mitchell
 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

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

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


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

2010-10-12 Thread Joachim Breitner
Hi,

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

Greetings,
Joachim

-- 
Joachim Breitner
  e-Mail: m...@joachim-breitner.de
  Homepage: http://www.joachim-breitner.de
  ICQ#: 74513189
  Jabber-ID: nome...@joachim-breitner.de


signature.asc
Description: This is a digitally signed message part
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


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

2010-10-11 Thread Neil Mitchell
Hi Ben,

 How can I disable the standard arguments 'help' and 'version'?

In general I suggest you email the author of the cmdargs package
directly, as well as cc'ing the mailing list (otherwise the author
might miss this message, as I did!)

In CmdArgs there is currently no way to suppress either --help or
--version, but I am currently reviewing a patch (from you!) and expect
that the next version will have both these features. The hard part is
making sure the defaults match what people expect and that the options
to modify the behaviour are discoverable and natural, but I'm sure
I'll find something.

Thanks, Neil



 If you're not fully committed to the cmdargs package, you might try my
 package 'console-program' instead
 http://hackage.haskell.org/package/console-program. It does not have
 built-in --help or --version functionality. (There is a function
 'showUsage' that takes the description of the command/option structure
 of your program, and prints --help style usage information, but you
 use this at your own discretion.)

 Thanks, looks good. I will certainly try it out.

 Cheers
 Ben

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

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


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

2010-10-11 Thread Magnus Therning
On 11/10/10 22:04, Neil Mitchell wrote:
 Hi Ben,

 How can I disable the standard arguments 'help' and 'version'?

 In general I suggest you email the author of the cmdargs package
 directly, as well as cc'ing the mailing list (otherwise the author
 might miss this message, as I did!)

 In CmdArgs there is currently no way to suppress either --help or
 --version, but I am currently reviewing a patch (from you!) and expect
 that the next version will have both these features. The hard part is
 making sure the defaults match what people expect and that the options
 to modify the behaviour are discoverable and natural, but I'm sure
 I'll find something.

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?

/M

-- 
Magnus Therning(OpenPGP: 0xAB4DFBA4)
magnus@therning.org   Jabber: magnus@therning.org
http://therning.org/magnus identi.ca|twitter: magthe



signature.asc
Description: OpenPGP digital signature
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


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

2010-10-11 Thread 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

(alternatively, you may wish to provide a more full-featured version
like what darcs does by using a pager)

-- 
Ivan Lazar Miljenovic
ivan.miljeno...@gmail.com
IvanMiljenovic.wordpress.com
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


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

2010-10-04 Thread Ben Franksen
Arie Peterson wrote:
 On Sun, 03 Oct 2010 19:18:08 +0200, Ben Franksen
 ben.frank...@online.de wrote:
 How can I disable the standard arguments 'help' and 'version'?
 
 If you're not fully committed to the cmdargs package, you might try my
 package 'console-program' instead
 http://hackage.haskell.org/package/console-program. It does not have
 built-in --help or --version functionality. (There is a function
 'showUsage' that takes the description of the command/option structure
 of your program, and prints --help style usage information, but you
 use this at your own discretion.)

Thanks, looks good. I will certainly try it out.

Cheers
Ben

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