2013-03-17 9 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

'man man'があなたを始めます。 'groff'も参照してください。 –

+2

@MarcB 'man'や' groff'のマニュアルページでは、 '[...]'はオプションの引数を示し、 '|'は選択肢を示していますか?私はこれがBackus-Naur構文表記のバリエーションだと思う。 – Barmar

答えて

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. 

だから私はこの概要の表記は歴史的に形成されてきたと思います。