helpBanner
immutable
auto helpBanner =
(`gen-package-version ` ~ genPackageVersionInfo.packageVersion ~ `
<https://github.com/Abscissa/gen-package-version>
-------------------------------------------------
Generates a D module with version information automatically-detected
from git or hg and (optionally) dub. This generated D file is automatically
added to .gitignore/.hgignore if necessary (unless using --no-ignore-file).
It is recommended to run this via DUB's preGenerateCommands by copy/pasting the
following lines into your project's dub.sdl (make sure to edit "path/to/src"
and "your.package.name" as needed):
dependency "gen-package-version" version="~>1.0.4"
preGenerateCommands \
"dub run gen-package-version -- your.package.name --root=$PACKAGE_DIR --src=path/to/src"
Or dub.json:
"dependencies": {
"gen-package-version": "~>1.0.4"
},
"preGenerateCommands":
["dub run gen-package-version -- your.package.name --root=$PACKAGE_DIR --src=path/to/src"]
USAGE:
gen-package-version [options] your.package.name --src=path/to/src
gen-package-version [options] your.package.name --dub
EXAMPLES:
gen-package-version foo.bar --src=source/dir
Generates module "foo.bar.packageVersion" in the file:
source/dir/foo/bar/packageVersion.d
Access the info from your program via:
import foo.bar.packageVersion;
writeln("Version: ", packageVersion);
writeln("Built on: ", packageTimestamp);
gen-package-version foo.bar --src=source/dir --ddoc=ddoc/dir
Same as above, but also generates a DDOC macro file:
ddoc/dir/packageVersion.ddoc
Which defines the macros: $(FOO_BAR_VERSION), $(FOO_BAR_TIMESTAMP)
and $(FOO_BAR_TIMESTAMP_ISO).
gen-package-version foo.bar --dub
Generates module "foo.bar.packageVersion" in the file:
(your_src_dir)/foo/bar/packageVersion.d
Where (your_src_dir) above is auto-detected via "dub describe".
The first path in "importPaths" is assumed to be (your_src_dir).
Additional info is available when using --dub:
writeln("This program's name is ", packageName);
Note that even if --dub isn't used, gen-package-version might still run dub
anyway if detecting the version through git/hg fails (for example, if the
package is not in a VCS-controlled working directory, such as the case when
a package is downloaded via dub).
OPTIONS:`).replace("\t", " ");
The --help message