A point in syntax in GNU programs.
Hi:
For some commands the command synopsis (syntax) is given like this: command [a|b] [args ...] I take mplayer (perhaps not GNU) to illustrate the point: mplayer [cdda|cddb]://track[-endtrack][:speed][/device] [options] mplayer [dvd|dvdnav]://[title|[start_title]-end_title] [options] An item inside square brackets is optional. The pipe sign is the 'or' logical connective (disjunction). But then, what is [cdda|cddb]? If optional, I can omit it: it makes no sense because there are more the one possible synopsis for the command line. Any clue? |
I am not sure I understand the question as you seem to have already answered it??
[] - optional | - you can use this one or that one [cdda|cddb] - both of these are optional but you can only use cdda OR cddb Where is the confusion? |
Quote:
It's like you described it. The parts inside square braces are optional, and items separated by pipes are mutually exclusive (in other words you must pick exactly one item from the list). |
Quote:
|
I don’t user mplayer, but shouldn't it be [(cdda|cddb)://] if it’s not optional but exactly one of cdda or cddb has to appear in combination with ://? Optional syntax would be [cdda://|cddb://].
|
The problem, if there is one, is that there are other synopsis. Take these two, for instance:
mplayer [options] [file|URL|playlist|-] mplayer [options] file1 [specific options] [file2] [specific options] In fact, neither cdda nor cddb is mandatory, as you can see from the example. |
Quote:
|
You are right. My examples were misleading.
|
All times are GMT -5. The time now is 02:08 PM. |