How to denote that a command line argument is optional when printing usage

后端 未结 3 1551
情书的邮戳
情书的邮戳 2021-01-30 02:18

Assume that I have a script that can be run in either of the following ways.

./foo arg1 arg2
./foo

Is there a generally accepted way to denote

3条回答
  •  南笙
    南笙 (楼主)
    2021-01-30 03:04

    Yes, the square brackets indicate optional arguments in Unix man pages.

    From "man man":

    [-abc] any or all arguments within [ ] are optional.

提交回复
热议问题