CLI Usage

CLI Usage #

usage: gotemplate [<flags>] <command> [<args> ...]

An extended template processor for go.

See: https://coveooss.github.io/gotemplate for complete documentation.

Flags:
  -h, --[no-]help                Show context-sensitive help (also try --help-man). ($GOTEMPLATE_HELP)
      --[no-]color               Force rendering of colors event if output is redirected (alias: --c)
                                 ($GOTEMPLATE_COLOR)
  -v, --[no-]version             Get the current version of gotemplate
      --template-log-level=level  
                                 Set the template logging level. Accepted values: disabled,
                                 panic, fatal, error, warning, info, debug, trace (alias: --tll)
                                 ($GOTEMPLATE_TEMPLATE_LOG_LEVEL)
  -L, --internal-log-level=level  
                                 Set the internal logging level. Accepted values: disabled, panic, fatal,
                                 error, warning, info, debug, trace (alias: --ill, --ll, --log-level)
                                 ($GOTEMPLATE_INTERNAL_LOG_LEVEL)
  -F, --internal-log-file-path=path  
                                 Set a file where verbose logs should be written (alias: --ilfp)
                                 ($GOTEMPLATE_INTERNAL_LOG_FILE_PATH)
      --template-log-file-level=level  
                                 Set the template logging level for the verbose logs file (alias: --tlfl)
                                 ($GOTEMPLATE_TEMPLATE_LOG_FILE_LEVEL)
      --internal-log-file-level=level  
                                 Set the internal logging level for the verbose logs file (alias: --ilfl)
                                 ($GOTEMPLATE_INTERNAL_LOG_FILE_LEVEL)
      --[no-]base                Turn off all addons (they could then be enabled explicitly)
                                 ($GOTEMPLATE_BASE)
      --[no-]razor               Razor Addon (ON by default) (off: --no-razor) ($GOTEMPLATE_RAZOR)
      --[no-]extension           Extension Addon (ON by default) (alias: --ext) (off: --next, --no-ext,
                                 --no-extension) ($GOTEMPLATE_EXTENSION)
      --[no-]math                Math Addon (ON by default) (off: --no-math) ($GOTEMPLATE_MATH)
      --[no-]sprig               Sprig Addon (ON by default) (off: --no-sprig) ($GOTEMPLATE_SPRIG)
      --[no-]data                Data Addon (ON by default) (off: --no-data) ($GOTEMPLATE_DATA)
      --[no-]logging             Logging Addon (ON by default) (off: --no-logging) ($GOTEMPLATE_LOGGING)
      --[no-]runtime             Runtime Addon (ON by default) (off: --no-runtime) ($GOTEMPLATE_RUNTIME)
      --[no-]utils               Utils Addon (ON by default) (off: --no-utils) ($GOTEMPLATE_UTILS)
      --[no-]net                 Net Addon (ON by default) (off: --nnet, --no-net) ($GOTEMPLATE_NET)
      --[no-]os                  OS Addon (ON by default) (off: --no-os, --nos) ($GOTEMPLATE_OS)
      --[no-]git                 Git Addon (ON by default) (off: --ngit, --no-git) ($GOTEMPLATE_GIT)
                                 ($GOTEMPLATE_IGNORE_MISSING_PATHS)
      --ignore-razor=regex ...   Do not consider the list of excluded Razor name as razor expression (alias:
                                 --ir)

Args:
  [<templates>]  Template files or commands to process

Commands:
help [<command>...]
    Show help.


run [<flags>] [<templates>...]

        --delimiters={{,}},@       Define the default delimiters for go template (separate the left,
                                   right and razor delimiters by a comma) (alias: --d, --del)
                                   ($GOTEMPLATE_DELIMITERS)
    -i, --import=file ...          Import variables files (could be any of YAML, JSON or HCL format)
                                   ($GOTEMPLATE_IMPORT)
        --import-if-exist=file ...  
                                   Import variables files (do not consider missing file as an error) (alias:
                                   --iie) ($GOTEMPLATE_IMPORT_IF_EXIST)
    -V, --var=values ...           Import named variables (if value is a file, the content is loaded)
                                   ($GOTEMPLATE_VAR)
    -t, --type=TYPE                Force the type used for the main context (Json, Yaml, Hcl)
                                   ($GOTEMPLATE_TYPE)
    -p, --patterns=pattern ...     Additional patterns that should be processed by gotemplate
                                   ($GOTEMPLATE_PATTERNS)
    -e, --exclude=pattern ...      Exclude file patterns (comma separated) when applying gotemplate
                                   recursively ($GOTEMPLATE_EXCLUDE)
    -o, --[no-]overwrite           Overwrite file instead of renaming them if they exist (required only if
                                   source folder is the same as the target folder) ($GOTEMPLATE_OVERWRITE)
    -s, --substitute=exp ...       Substitute text in the processed files by applying the regex substitute
                                   expression (format: /regex/substitution, the first character acts as
                                   separator like in sed, see: Go regexp) ($GOTEMPLATE_SUBSTITUTE)
    -E, --[no-]remove-empty-lines  Remove empty lines from the result (alias: --re, --rel, --remove-empty)
                                   ($GOTEMPLATE_REMOVE_EMPTY_LINES)
    -r, --[no-]recursive           Process all template files recursively ($GOTEMPLATE_RECURSIVE)
    -R, --recursion-depth=depth    Process template files recursively specifying depth (alias: --rd)
                                   ($GOTEMPLATE_RECURSION_DEPTH)
        --source=folder            Specify a source folder (default to the current folder) (alias: --s)
                                   ($GOTEMPLATE_SOURCE)
        --target=folder            Specify a target folder (default to source folder) (alias: --t)
                                   ($GOTEMPLATE_TARGET)
    -I, --[no-]stdin               Force read of the standard input to get a template definition (useful
                                   only if GOTEMPLATE_NO_STDIN is set) ($GOTEMPLATE_STDIN)
    -f, --[no-]follow-symlinks     Follow the symbolic links while using the recursive option (alias:
                                   --fs) ($GOTEMPLATE_FOLLOW_SYMLINKS)
    -P, --[no-]print               Output the result directly to stdout ($GOTEMPLATE_PRINT)
    -d, --[no-]disable             Disable go template rendering (used to view razor conversion)
                                   ($GOTEMPLATE_DISABLE)
        --[no-]accept-no-value     Do not consider rendering <no value> as an error (alias: --anv,
                                   --no-value, --nv) ($GOTEMPLATE_NO_VALUE)
    -S, --[no-]strict-error-validation  
                                   Consider error encountered in any file as real error (alias: --sev,
                                   --strict) ($GOTEMPLATE_STRICT_ERROR)
        --strict-assignations-validation=warning  
                                   Enforce strict assignation validation on global variables (alias:
                                   --sav) ($GOTEMPLATE_STRICT_ASSIGNATIONS_VALIDATION)
        --[no-]ignore-missing-import  
                                   Exit with code 0 even if import does not exist (alias: --imi)
                                   ($GOTEMPLATE_IGNORE_MISSING_IMPORT)
        --[no-]ignore-missing-source  
                                   Exit with code 0 even if source does not exist (alias: --ims)
                                   ($GOTEMPLATE_IGNORE_MISSING_SOURCE)
        --[no-]ignore-missing-paths  
                                   Exit with code 0 even if import or source do not exist (alias: --imp)
                                   ($GOTEMPLATE_IGNORE_MISSING_PATHS)
        --ignore-razor=regex ...   Do not consider the list of excluded Razor name as razor expression
                                   (alias: --ir)

list [<flags>] [<filters>...]
    Get detailed help on gotemplate functions

    -f, --[no-]functions  Get detailed help on function
    -t, --[no-]templates  List the available templates
    -l, --[no-]long       Get detailed list
    -a, --[no-]all        List all
    -c, --[no-]category   Group functions by category