Skip to content
Piotr Meyer edited this page Oct 23, 2017 · 2 revisions

RST format test

Meta-data
# meta <key>:<value> <key>:<value> <key>:<value>

Meta-lines should be formatted in pleasant-for-raw-eye form and may be split into multiple lines. Meta-lines shouldn't be overused because it can create visual chaos.

At this moment I can see two, possible use-cases for meta fields:

  • prog:<name or path to binary>: with full pathname or program name. It may be used by filter to adjust behaviour or to format data according additional criteria, based on program name or version.

  • fmt:<format string>: additional information about columns (sizes, data types). For example fmt:'%ip4 %20s %i %-': should be interpreted as "treat first column as IPv4 addr, second as string with max length 20 chars, third as integer, type of fourth should be determine in other way"

    It is somewhat redundant feature because column format may also be determined by:

    • well-known names, hard-coded into tools (Interface, MAC, Route, IPv4)
    • column names, program names and - possible - program version taken from meta-fields and described in optional configuration database (like termcap one)
    • format can be guessed ("if it is all-numeric one then convert it to standard integer") although it requires some caution

Example:

# meta prog:/bin/df
# meta fmt:'%s %s %s %s"
-a command-line option "a"
-b file options can have arguments and long descriptions
--long options can be long also
--input=file long options can also have arguments
/V DOS/VMS-style options too
Clone this wiki locally