views:

92

answers:

1

I don't mean a man page or equivalent.

You know how, when you start command line applications with insufficient or invalid command line arguments, they often output a one-liner showing the command line arguments they expected, then quit.

Is there a standard way to write this one-liner? (i.e. Which command line arguments are required, which are optional, which must be numeric, and probably other constraints that I haven't thought of)

+7  A: 

Yes. See also.

Jason
Now that's a short but insightful answer :)
Nicolas
Accept this one. I would add that on most platforms, you should use argv[0] to print the program's name, rather than hardcode it
T.E.D.
Roger that. Thank you
frou
@T.E.D.: which has really on results on those rare occasions when argv *isn't* the executable name... Not that I let that stop me.
dmckee