You are not logged in.

#1 2010-07-24 23:15:05

egan
Member
From: Mountain View, CA
Registered: 2009-08-17
Posts: 273

Standards for Help Lines in Programs? [SOLVED]

It seems that the help lines for GNU programs are very standardized. I am wondering where the documentation for this syntax is.

If you don't know what I am talking about, here is an example:
tar [-] A --catenate --concatenate | c --create | d --diff --compare | --delete | r --append | t --list | --test-label | u --update | x --extract --get [options] [pathname ...]

When do you use |, when do you use []? Why are some things underlined? This is what I want to know, so that I can write more consistent help lines.

Last edited by egan (2010-07-25 00:21:31)

Offline

#2 2010-07-24 23:16:46

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Standards for Help Lines in Programs? [SOLVED]

| means or, [] means an optional part
http://en.wikipedia.org/wiki/Backus–Naur_Form

'a | b' means you can specify either a or b, you can't use them both at the same time

Last edited by karol (2010-07-24 23:19:08)

Offline

#3 2010-07-25 00:21:08

egan
Member
From: Mountain View, CA
Registered: 2009-08-17
Posts: 273

Re: Standards for Help Lines in Programs? [SOLVED]

Interesting... I guess that answers my question. Backus-Naur form.

Offline

Board footer

Powered by FluxBB