At 00:38 2007-01-22, David wrote:
>Victor A. Wagner Jr. a écrit :
> >>>>
> >>>> /// Now that we've done the preliminaries, the main program is dead
> >>>> simple
> >>>> int main(int argc, char* argv[])
> >>>> {
> >>>> /// make sure we have something to score (argc will be at
> >>>> least 1 because the
> >>>> /// name of the program (as invoked) is put into argv[0] so
> >>>> there is at least
> >>>> /// one thing in the argv[] array
> >>>> if (argc < 2)
> >>>> {
> >>>> /// no args... show the way to use the program
> >>>> cout << "Usage: " << *argv << " word[ word]...\n";
> >>>>
> >> may be a return 1; here
> >>
> >
> > could be... I didn't really consider it an error
> > as such. I often run my command line utilities
> > with NO arguments to get reminded what the args
> > and options are (no options here, of course)
> >
> >
>
>The same.
>But I change my mind in my production environnement when a day
>we changed the args used to launched an exe within a .sh, so the exe
>silenty return 0 to the sh
>but do nothing else print the notice. Now, I prefer to distinguish
>between -? or --help wich are
>notice calling and empty call which can be invalid or valid (depend on
>the exe).
yeah, probably a good idea afterall.... looking
back over some very old (2 decades??) code we'd
print the "help" and return 1; don't know when I quit doing that.
BTW, thanks again for finding the <exception>
-> <stdexcept> error... I hope that Rick finds it
>David
>
>
>
>
>
>To unsubscribe, send a blank message to
><mailto:[EMAIL PROTECTED]>.
>Yahoo! Groups Links
>
>
>
Victor A. Wagner Jr. http://rudbek.com
The five most dangerous words in the English language:
"There oughta be a law"