2013-03-17 45 views
6

閱讀手冊頁時,以我的經驗總是有一個synopsis部分。例如手冊頁簡介表示法

MV(1)      BSD General Commands Manual     MV(1) 

NAME 
mv -- move files 

SYNOPSIS 
mv [-f | -i | -n] [-v] source target 
mv [-f | -i | -n] [-v] source ... directory 

我對synopsis部分中使用的符號感興趣。它叫什麼,我在哪裏可以找到更多關於它的信息?

總的來說,它看起來非常直截了當,我通常可以弄清楚它的含義,但我想開始將它用於我自己的文檔,所以我想我應該找出我之前可以學習的語法我開始寫我自己的手冊頁。

+0

'男人'會讓你開始。也看起來'groff'。 – 2013-03-17 06:24:35

+2

@MarcB在'man'或'groff'手冊頁裏,它解釋了什麼,例如'[...]'表示可選參數,'|'表示可選項?我認爲這是Backus-Naur語法表示法的變體。 – Barmar 2013-03-17 08:37:00

回答

4

這是男人男人 qoute:

The following conventions apply to the SYNOPSIS section and 
    can be used as a guide in other sections. 

    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. 

    Exact rendering may vary depending on the output device. For instance, man will 
    usually not be able to render italics when running in a terminal, and will 
    typically use underlined or coloured text instead. 

所以我覺得這大綱符號是歷史上形成的。