Module res_tool_util

Module res_tool_util 

Source
Expand description

Utilities for implementing cargo-zng-res-{tool} executables.

Note don’t depend on cargo-zng, just copy the source code of the utilities you need.

Constants§

ZR_APP
Env var set to package.metadata.zng.about.app or package.name
ZR_CACHE_DIR
Env var set to dir that the tool can use to store intermediary data for the specific request.
ZR_CRATE_NAME
Env var set to package.name in snake_case
ZR_DESCRIPTION
Env var set to package.description
ZR_FINAL
Env var set when it is running a tool that requested zng-res::on-final= again.
ZR_HELP
Env var set when it needs the tool print the help text shown in cargo zng res --tools.
ZR_HOMEPAGE
Env var set to package.homepage
ZR_LICENSE
Env var set to package.license
ZR_ORG
Env var set to package.metadata.zng.about.org or the first package.authors
ZR_PKG_AUTHORS
Env var set to package.authors
ZR_PKG_NAME
Env var set to package.name
ZR_QUALIFIER
Env var set to package.metadata.zng.about.qualifier
ZR_REQUEST
Env var set to the request file that called the tool.
ZR_REQUEST_DD
Env var set to the request file parent dir.
ZR_SOURCE_DIR
Env var set to the resources source directory.
ZR_TARGET
Env var set to the target file implied by the request file name.
ZR_TARGET_DD
Env var set to the target file parent dir.
ZR_TARGET_DIR
Env var set to the resources build target directory.
ZR_VERSION
Env var set to package.version
ZR_WORKSPACE_DIR
Env var set to the Cargo workspace directory that is parent to the res source.

Functions§

display_path
Format the path in the standard way used by cargo-zng.
path
Get a ZR_ path var.