Is there a “standard” format for command line/shell help text?

前端 未结 8 1436
难免孤独
难免孤独 2020-11-30 16:30

If not, is there a de facto standard? Basically I\'m writing a command line help text like so:

usage: app_name [opti         


        
8条回答
  •  温柔的废话
    2020-11-30 16:42

    I think there is no standard syntax for command line usage, but most use this convention:

    Microsoft Command-Line Syntax, IBM has similar Command-Line Syntax


    • Text without brackets or braces

      Items you must type as shown

    • Placeholder for which you must supply a value

    • [Text inside square brackets]

      Optional items

    • {Text inside braces}

      Set of required items; choose one

    • Vertical bar {a|b}

      Separator for mutually exclusive items; choose one

    • Ellipsis

      Items that can be repeated

提交回复
热议问题