man synopsis standard compliance


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers man synopsis standard compliance
# 1  
Old 12-05-2007
man synopsis standard compliance

In different online sources, I found bits and pieces of information about those square and angular brackets and pipes. From what I have read, I can conclude it looks like this:

1. Options outside any brackets are mandatory
2. Options inside these < .. > are mandatory too
3. Options inside [ .. ] are optional
4. | works like an "exclusive or", separating options inside the brackets they are placed (or outside in case they are not inside any brackets).
5. Options listed with no separators with '-' in front (ex: -abcd) can be used in any combination with each other (i.e. "inclusive or")

First problem is that I'm not even sure I am correct here. Second, I cannot convince developers (I am a tester) to be compliant with any standard in user's manual and in help, since I cannot find any standard. Our project has several dozens of command line utilities each with elaborate parameter strings. The developers make them even more confusing by using '|' both as exclusive and inclusive or. In our latest release I realized that those confuse even me, so I'm concerned about our clients. Is there any standard to which man synopsis with those brackets and pipes is compliant? Is there any convincing source online, where that standard is carefully described?

Last edited by vkleban; 12-05-2007 at 05:33 PM..
# 2  
Old 12-05-2007
Interesting, GNU coding standards are very lean on this topic.

I've had a look at a Solaris example...

Code:
     man [-] [-adFlrt] [-M path] [-T macro-package]  [-s section]
     name...

Notice that there is not an option "-adFlrt", they are all different flags, but with no inclusive OR between them. I would tend towards the exclusive OR however I would make the documentation concise and remove ambiguity.
# 3  
Old 12-05-2007
Yes, good point about Solaris. Is seems that my research has failed Smilie It is very strange that such a fundamental thing in all UNIXes and UNIX-like operating systems is not standardized in any way.
# 4  
Old 12-05-2007
Quote:
Originally Posted by vkleban
It is very strange that such a fundamental thing in all UNIXes and UNIX-like operating systems is not standardized in any way.
Not really, UNIX is about mechanism, not policy.
# 5  
Old 12-06-2007
Hi.

Is this convincing?
Quote:
bold text type exactly as shown.
italic text replace with appropriate argument.
[-abc] any or all arguments within [ ] are optional.
-a|-b options delimited by | cannot be used together.
argument ... argument is repeatable.
[expression] ... entire expression within [ ] is repeatable.

The command or function illustration is a pattern that should match all
possible invocations. In some cases it is advisable to illustrate sev-
eral exclusive invocations as is shown in the SYNOPSIS section of this
manual page.

-- excerpt from GNU/Linux man man
I agree that consistency is to be valued - especially for a set of commands in a specific project -- however, {GNU/Linux, Solaris, other *nix}-universe consistency and consensus is unlikely in my opinion. It may even be undesirable -- too many rules have a chilling effect on innovation.

Your particular situation may be saying more about your developers than about the *nix universe.

Best wishes ... cheers, drl
 
Login or Register to Ask a Question

Previous Thread | Next Thread

5 More Discussions You Might Find Interesting

1. OS X (Apple)

POSIX compliance...

Thanks to all you guys about posix compliance I have learnt an enormous amount over the last few days. I have written a program that is an Egg Timer with simple animation. I now realise how sophisticated 'bash' is compared to full posix compliance. The code below has passed all of the tests from... (11 Replies)
Discussion started by: wisecracker
11 Replies

2. HP-UX

Password compliance setting

I need to set password compliance for some servers in my company. However, the requirements are that we need to set different password policies for 3 different user groups within the company. These are : System Users: i.e root, etc Batch/Application Users: oracle, bscs, etc Standard User:... (0 Replies)
Discussion started by: anaigini45
0 Replies

3. UNIX for Dummies Questions & Answers

Redirect Standard output and standard error into spreadsheet

Hey, I'm completely new at this and I was wondering if there is a way that I would be able to redirect the log files in a directories standard output and standard error into and excel spreadsheet in anyway? Please remember don't use too advanced of terminology as I just started using shell... (6 Replies)
Discussion started by: killaram
6 Replies

4. Shell Programming and Scripting

standard error to standard out question

Hi there how can i get the result of a command to not give me its error. For example, on certain systems the 'zfs' command below is not available, but this is fine becaues I am testing against $? so i dont want to see the message " command not found" Ive tried outputting to /dev/null 2>&1 to no... (5 Replies)
Discussion started by: hcclnoodles
5 Replies

5. UNIX for Advanced & Expert Users

sudo & Sox compliance

Hello, I am trying to convince my boss to stop allowing our users to login as root (superuser). Currently our users login to our unix server with their own account, then as needed, they will do an su and put in the root password. This scares me, for a bunch of reasons. Mainly, one is that we... (1 Reply)
Discussion started by: rwallaceisg
1 Replies
Login or Register to Ask a Question