2

For a certain extensive BASH script I want to build a help menu, similar like the one you see when you run mplayer --help for example.

Usage:   mplayer [options] [url|path/]filename

Basic options: (complete list in the man page)
 -vo <drv>        select video output driver ('-vo help' for a list)
 -ao <drv>        select audio output driver ('-ao help' for a list)

What is the convention for using the different brackets [, ], <, > and other characters | etc? What is the conventional layout of such a menu? How do I explain the user witch options are mandatory?

There is probably a guideline somewhere, but I can not find it.

CousinCocaine
  • 591
  • 6
  • 20

1 Answers1

3

taken from wikipedia:

 - angle brackets for required parameters: ping <hostname>
 - square brackets for optional parameters: mkdir [-p] <dirname>
 - ellipses for repeated items: cp <source1> [source2...] <dest>
 - vertical bars for choice of items: netstat {-t|-u}
 - curly braces enclose mutually exclusive alternate values
CousinCocaine
  • 591
  • 6
  • 20
Deleted User
  • 2,551
  • 1
  • 11
  • 18
  • This was indeed what I was looking for, but the answer is a bit concise. For example, what do the `{` and `}` do in your example? What is the correct way to build op the menu? How much do you indent the options? When do you use a single dash `-` and a double dash `--` for an option, etc. How do I build a help menu from scratch (the right way)? – CousinCocaine Jun 16 '14 at 08:11