utilities.cmd

terminal

(terminal {program-short-desc :short-desc, args :args, cli-args :args-desc, execute :execute})
Executes program in terminal.

Arguments: {_ :short-description
            _ :args
            _ :args-description
            _ :execute}

Run [:execute] with command line arguments in [:args].

Supplies program with options.
Supported command line options are -h (--help)
                                   -t (--trace)

Wraps unhandled exceptions. If -t is set, returns full stack trace.
Otherwise, returns only exception message.

Help provides short program description, description of command line
options, description of command line arguments, etc.

Short description is supplied with [:short-description] key.

Description of command line arguments is set in [args-description] key.
The format for arguments description is
    {:required
     [[argument-name1 argument-description1]
      [argument-name2 argument-description2]
       ...]
     :optional
     [[optional-argument-name1 argument-description1]
      [optional-argument-name2 argument-description2]
       ...]}

## Usage

    (require '[utilities.cmd :refer :all])

    (def arguments
         {:short-desc "Program short description goes here."
          :args '(arg1 arg2 ... [optional-arg1] [optional-arg2] ...)
          :args-desc {:required
                      [["arg1" "Description for arg1 goes here."]
                       ["arg2" "Description for arg2 goes here."]
                       ...]
                      :optional
                      [["optional-arg1" "Description for optional-arg1 goes here."]
                       ["optional-arg2" "Description for optional-arg2 goes here."]
                       ...]}
          :execute (fn[args](println "Hello, world!"))})

    (terminal arguments)