Questions tagged [usage-message]

5 questions
57
votes
8 answers

Should the command line "usage" be printed on stdout or stderr?

When printing the "usage" of an application, should it be done on stdout or on stderr? Depending on the application I've seen several cases, but there doesn't seem to be one rule. Maybe I'm mistaken and there is one good practice. In that case, what…
Olivier Grégoire
  • 33,839
  • 23
  • 96
  • 137
8
votes
4 answers

Formatting usage messages

If you take a look at the Combinatorica package in Mathematica8 in (mathematicapath)/AddOns/LegacyPackages/DiscreteMath/Combinatorica.m you will find the definitions of functions. What I'm interested to know is how Mathematica knows how to format…
jmlopez
  • 4,853
  • 4
  • 40
  • 74
4
votes
4 answers

What is the best way to include a "help" message in a console application?

I am writing a console application which is rapidly gaining many command line arguments and flags. For this reason I want the user to be able to access a description of these flags and what purpose they serve. There are several possible solutions I…
Dan
  • 12,857
  • 7
  • 40
  • 57
1
vote
1 answer

Python Argparse Adding Text To Usage Message

I am working on a small Python program that needs to get some command line parameters and use argparse to display usage message . I have these 2 lines parser.add_argument("-r",type=int,default=1) parser.add_argument("-c",type=int,default=2) And…
user1551120
  • 627
  • 2
  • 8
  • 14
0
votes
1 answer

Best practices of writing a good usage output for a program

I've been looking online a lot for guidelines that explains how to write a good usage output of a program. Lets say I have some little program written in Python: import sys def main(): if len(sys.argv < 5): print("Wrong usage") …
Wahalez
  • 489
  • 1
  • 6
  • 22