# program name, name for the executable
ProgramName: redo

# package name
# - For standalone program that does not belong to any package, e.g., 
#   https://github.com/suntong/easygen/blob/7791e4f0e5605543d27da1671a21376cdb9dcf2a/easygen/easygen.go
#   just ignore the first line, the `package` output, and copy the rest
# - If you don't mind using a separated file to handle commandline paramters,
#   then name the package as "main". see the spin-out "TF-minus1.go" file under
#   https://github.com/suntong/easygen/tree/d1ab0b5fe80ddac57fe9ef51f6ccb3ab998cd5ee
# - If you are using it in a pacakge, look no further than
#   https://github.com/suntong/easygen/blob/master/easygenapi/config.go
#   which was a direct dump: easygen test/commandlineFlag | gofmt > easygenapi/config.go
#
PackageName: main

Name: redo
Desc: "global option redo"
Text: '  redo global option via automatic code-gen'
Global: true
NumArg: cli.ExactN(1)

Options:
  - Name: Host
    Type: string
    Flag: H,host
    Usage: host address
    Value: "$HOST"

  - Name: Port
    Type: int
    Flag: p,port
    Usage: listening port
    Value: 80


Command:

  - Name: build
    Desc: "Build the network application"
    Text: 'Usage:\n  redo build [Options] Arch(i386|amd64)'
    NumArg: cli.ExactN(1)
    Self: true
    
    Options:
      - Name: Self
        Type: '*buildT'
        Flag: c,config
        Usage: config file
        Value: build.json

      - Name: Dir
        Type: string
        Flag: dir
        Value: "./"
        Usage: source code root dir

      - Name: Suffix
        Type: string
        Flag: suffix
        Value: ".go,.c,.s"
        Usage: "source file suffix"

      - Name: Out
        Type: string
        Flag: o,out
        Usage: "output filename"

  - Name: install
    Desc: "Install the network application"
    Text: 'Usage:\n  redo install [Options] package [package...]'
    NumArg: cli.AtLeast(1)
    
    Options:
      - Name: Dir
        Type: string
        Flag: dir
        Value: "./"
        Usage: source code root dir

      - Name: Suffix
        Type: string
        Flag: suffix
        Value: ".go,.c,.s"
        Usage: "source file suffix"

      - Name: Out
        Type: string
        Flag: o,out
        Usage: "output filename"

  - Name: publish
    Desc: "Publish the network application"
    NumOption: cli.AtLeast(1)
    
    Options:
      - Name: Dir
        Type: string
        Flag: '*d,dir'
        Usage: publish dir

      - Name: Suffix
        Type: string
        Flag: suffix
        Value: ".go,.c,.s"
        Usage: "source file suffix"

      - Name: Out
        Type: string
        Flag: o,out
        Usage: "output filename"

      - Name: List
        Type: bool
        Flag: l,list
        Usage: "list all sub commands"

