I am sure there's no one answer to this, but interested in the philosophy of folks here. I am working on a CLI tool that has required params. I am using commander for handling the commands/options etc which works great. The question I had is with regard to usage info. This tool always requires you to choose something, so my question is should I display usage automatically if no commands are provided, OR should I say "use --help for a list of commands".
On Sat, Dec 31, 2011 at 4:23 PM, Glenn Block <glenn.bl...@gmail.com> wrote: > I am sure there's no one answer to this, but interested in the philosophy > of folks here. I am working on a CLI tool that has required params. I am > using commander for handling the commands/options etc which works great. > The question I had is with regard to usage info. This tool always requires > you to choose something, so my question is should I display usage > automatically if no commands are provided, OR should I say "use --help for > a list of commands".
What's "use --help for al ist of commands" if not usage info? Why not go a step further, if possible, and preface this kind of message with the obvious common cases, if there are any. It can't hurt.
I guess the real question I am asking is being that the command requires at least some params, does it make sense to even have --help? Or should it just print out the help for you and save you the command?
On Sat, Dec 31, 2011 at 1:51 PM, Dean Landolt <d...@deanlandolt.com> wrote:
> On Sat, Dec 31, 2011 at 4:23 PM, Glenn Block <glenn.bl...@gmail.com>wrote:
>> I am sure there's no one answer to this, but interested in the philosophy >> of folks here. I am working on a CLI tool that has required params. I am >> using commander for handling the commands/options etc which works great. >> The question I had is with regard to usage info. This tool always requires >> you to choose something, so my question is should I display usage >> automatically if no commands are provided, OR should I say "use --help for >> a list of commands".
> What's "use --help for al ist of commands" if not usage info? Why not go a > step further, if possible, and preface this kind of message with the > obvious common cases, if there are any. It can't hurt.
On Sat, Dec 31, 2011 at 1:51 PM, Dean Landolt <d...@deanlandolt.com> wrote:
> On Sat, Dec 31, 2011 at 4:23 PM, Glenn Block <glenn.bl...@gmail.com>wrote:
>> I am sure there's no one answer to this, but interested in the philosophy >> of folks here. I am working on a CLI tool that has required params. I am >> using commander for handling the commands/options etc which works great. >> The question I had is with regard to usage info. This tool always requires >> you to choose something, so my question is should I display usage >> automatically if no commands are provided, OR should I say "use --help for >> a list of commands".
> What's "use --help for al ist of commands" if not usage info? Why not go a > step further, if possible, and preface this kind of message with the > obvious common cases, if there are any. It can't hurt.
if there's nothing useful you can do with no args then definitely
treat it as --help IMHO, though often for example I would use it for
parsing from stdin, default path to CWD, etc, but it really depends on
the tool i guess
On Dec 31 2011, 1:56 pm, Glenn Block <glenn.bl...@gmail.com> wrote:
> npm prints out the list of commands if you just type "npm"
> On Sat, Dec 31, 2011 at 1:51 PM, Dean Landolt <d...@deanlandolt.com> wrote:
> > On Sat, Dec 31, 2011 at 4:23 PM, Glenn Block <glenn.bl...@gmail.com>wrote:
> >> I am sure there's no one answer to this, but interested in the philosophy
> >> of folks here. I am working on a CLI tool that has required params. I am
> >> using commander for handling the commands/options etc which works great.
> >> The question I had is with regard to usage info. This tool always requires
> >> you to choose something, so my question is should I display usage
> >> automatically if no commands are provided, OR should I say "use --help for
> >> a list of commands".
> > What's "use --help for al ist of commands" if not usage info? Why not go a
> > step further, if possible, and preface this kind of message with the
> > obvious common cases, if there are any. It can't hurt.
Cool. In this case I think like npm there is not really a default action.
Sent from my Windows Phone From: tjholowaychuk Sent: 1/1/2012 12:53 AM To: nodejs Subject: [nodejs] Re: CLI tools - should help display by default? if there's nothing useful you can do with no args then definitely treat it as --help IMHO, though often for example I would use it for parsing from stdin, default path to CWD, etc, but it really depends on the tool i guess
On Dec 31 2011, 1:56 pm, Glenn Block <glenn.bl...@gmail.com> wrote:
> npm prints out the list of commands if you just type "npm"
> On Sat, Dec 31, 2011 at 1:51 PM, Dean Landolt <d...@deanlandolt.com> wrote:
> > On Sat, Dec 31, 2011 at 4:23 PM, Glenn Block <glenn.bl...@gmail.com>wrote:
> >> I am sure there's no one answer to this, but interested in the philosophy > >> of folks here. I am working on a CLI tool that has required params. I am > >> using commander for handling the commands/options etc which works great. > >> The question I had is with regard to usage info. This tool always requires > >> you to choose something, so my question is should I display usage > >> automatically if no commands are provided, OR should I say "use --help for > >> a list of commands".
> > What's "use --help for al ist of commands" if not usage info? Why not go a > > step further, if possible, and preface this kind of message with the > > obvious common cases, if there are any. It can't hurt.
On Sun, Jan 1, 2012 at 2:53 PM, Glenn Block <glenn.bl...@gmail.com> wrote: > Cool. In this case I think like npm there is not really a default > action.
> Sent from my Windows Phone > From: tjholowaychuk > Sent: 1/1/2012 12:53 AM > To: nodejs > Subject: [nodejs] Re: CLI tools - should help display by default? > if there's nothing useful you can do with no args then definitely > treat it as --help IMHO, though often for example I would use it for > parsing from stdin, default path to CWD, etc, but it really depends on > the tool i guess
> On Dec 31 2011, 1:56 pm, Glenn Block <glenn.bl...@gmail.com> wrote: >> npm prints out the list of commands if you just type "npm"
>> On Sat, Dec 31, 2011 at 1:51 PM, Dean Landolt <d...@deanlandolt.com> wrote:
>> > On Sat, Dec 31, 2011 at 4:23 PM, Glenn Block <glenn.bl...@gmail.com>wrote:
>> >> I am sure there's no one answer to this, but interested in the philosophy >> >> of folks here. I am working on a CLI tool that has required params. I am >> >> using commander for handling the commands/options etc which works great. >> >> The question I had is with regard to usage info. This tool always requires >> >> you to choose something, so my question is should I display usage >> >> automatically if no commands are provided, OR should I say "use --help for >> >> a list of commands".
>> > What's "use --help for al ist of commands" if not usage info? Why not go a >> > step further, if possible, and preface this kind of message with the >> > obvious common cases, if there are any. It can't hurt.