Command Line Syntax

III. Proposed Syntax

After above analysis, I come up with a command syntax system as described follows:

  • Command [Option1 Option2 ...] Data or
  • Command [Option1 Option2 ...]
    > Data

where option is -flag[:argument1:argument2: ...]

"-" is the first layer option separator which tells users and system that characters follow "-" are the first layer options. In the Lexical tools (lvg), they may be Global Behavior Options, Input Field Options, Output Filter Options, and Flow Components.

Similarly, ":" is the second layer option separator which tells users and system where the second layer option flags are.

In addition, an argument follows the second layer separator could be a predefined option or an arbitrary value. If it is a predefined option, they may take arguments as 3rd layers of options, and so on. Accordingly, this syntax can be expanded as long as layer separators are clearly provided.

Some options may take multiple arguments, in such cases, an arguments separator, "+" is used to distinguish these arguments for the same option.

For example:
lvg -i:input.txt -t:2 -SC -SI -f:l:ici~128+8

where:

  • This command does:
    • lvg: program name
    • -i:input.txt: read input from a specified file named input.txt.
    • -t:2: take field 2 from the input line as the input term.
    • -SC: show categories in names.
    • -SI: show inflections in names.
    • -f:l:ici~128+8: set up two flow components, l and ici, as the lvg flow.

  • The table representation of this command is:

    1st Layer Separator 1st Layer Options 2nd Layer Separator 2nd Layer Options 3rd Layer Separator 3rd Layer Options
    "-"

    i,

    t,

    SC,

    SI,

    f

     

    ":"

    input.txt,

    2,

     

     

    l,

    ici

    "~"

     

     

     

     

     

    128+8

  • The hierarchy structure representation is:
    lvg
    |
    +--i
    |     |
    |     +--input.txt (STR) => read input from a specified file named input.txt.
    |
    +--t
    |     |
    |     +--2 (INT) => take field 2 from the input line as the input term.
    |
    +--SC => show categories in names.
    |
    +--SI => show inflections in names.
    |
    +--f
    |
    +--l => setup flow component, lowercase.
    |
    +--ici
    |
    +--128+8 (INT+INT) => generate inflectional variants with specifying output category is 128 (Noun) and output inflection is 8 (plural).
    

Separators used in Lexical tools are defined as follows:

  • Option separators:

    1st Layer "-"
    2nd Layer ":"
    3rd Layer "~"
    4th Layer "#"
    5th Layer "$"

  • Arguments separator: "+"