CLI Usage

CLI Usage

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

An extended template processor for go.

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

Flags:
  -h, --help                     Show context-sensitive help (also try --help-man). ($GOTEMPLATE_HELP)
      --color                    Force rendering of colors event if output is redirected (alias: --c)
                                 ($GOTEMPLATE_COLOR)
  -v, --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)
      --base                     Turn off all addons (they could then be enabled explicitly)
                                 ($GOTEMPLATE_BASE)
      --razor                    Razor Addon (ON by default) (off: --no-razor) ($GOTEMPLATE_RAZOR)
      --extension                Extension Addon (ON by default) (alias: --ext) (off: --next, --no-ext,
                                 --no-extension) ($GOTEMPLATE_EXTENSION)
      --math                     Math Addon (ON by default) (off: --no-math) ($GOTEMPLATE_MATH)
      --sprig                    Sprig Addon (ON by default) (off: --no-sprig) ($GOTEMPLATE_SPRIG)
      --data                     Data Addon (ON by default) (off: --no-data) ($GOTEMPLATE_DATA)
      --logging                  Logging Addon (ON by default) (off: --no-logging) ($GOTEMPLATE_LOGGING)
      --runtime                  Runtime Addon (ON by default) (off: --no-runtime) ($GOTEMPLATE_RUNTIME)
      --utils                    Utils Addon (ON by default) (off: --no-utils) ($GOTEMPLATE_UTILS)
      --net                      Net Addon (ON by default) (off: --nnet, --no-net) ($GOTEMPLATE_NET)
      --os                       OS Addon (ON by default) (off: --no-os, --nos) ($GOTEMPLATE_OS)
      --git                      Git Addon (ON by default) (off: --ngit, --no-git) ($GOTEMPLATE_GIT)
                                 ($GOTEMPLATE_IGNORE_MISSING_PATHS)

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, --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, --remove-empty-lines       Remove empty lines from the result (alias: --re, --rel, --remove-empty)
                                   ($GOTEMPLATE_REMOVE_EMPTY_LINES)
    -r, --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, --stdin                    Force read of the standard input to get a template definition (useful
                                   only if GOTEMPLATE_NO_STDIN is set) ($GOTEMPLATE_STDIN)
    -f, --follow-symlinks          Follow the symbolic links while using the recursive option (alias:
                                   --fs) ($GOTEMPLATE_FOLLOW_SYMLINKS)
    -P, --print                    Output the result directly to stdout ($GOTEMPLATE_PRINT)
    -d, --disable                  Disable go template rendering (used to view razor conversion)
                                   ($GOTEMPLATE_DISABLE)
        --accept-no-value          Do not consider rendering <no value> as an error (alias: --anv,
                                   --no-value, --nv) ($GOTEMPLATE_NO_VALUE)
    -S, --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)
        --ignore-missing-import    Exit with code 0 even if import does not exist (alias: --imi)
                                   ($GOTEMPLATE_IGNORE_MISSING_IMPORT)
        --ignore-missing-source    Exit with code 0 even if source does not exist (alias: --ims)
                                   ($GOTEMPLATE_IGNORE_MISSING_SOURCE)
        --ignore-missing-paths     Exit with code 0 even if import or source do not exist (alias: --imp)
                                   ($GOTEMPLATE_IGNORE_MISSING_PATHS)

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

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