cli: Add version number to version and help commands

This commit is contained in:
armaniferrante 2021-04-06 17:55:01 -07:00
parent e7f6d637f4
commit 3eb1ee96c7
No known key found for this signature in database
GPG Key ID: 58BEF301E91F7828
1 changed files with 4 additions and 2 deletions

View File

@ -32,9 +32,11 @@ mod config;
mod template;
// Version of the docker image.
const DOCKER_BUILDER_VER: &str = env!("CARGO_PKG_VERSION");
const VERSION: &str = env!("CARGO_PKG_VERSION");
const DOCKER_BUILDER_VERSION: &str = VERSION;
#[derive(Debug, Clap)]
#[clap(version = VERSION)]
pub struct Opts {
#[clap(subcommand)]
pub command: Command,
@ -383,7 +385,7 @@ fn build_cwd(
fn build_cwd_verifiable(workspace_dir: &Path) -> Result<()> {
// Docker vars.
let container_name = "anchor-program";
let image_name = format!("projectserum/build:v{}", DOCKER_BUILDER_VER);
let image_name = format!("projectserum/build:v{}", DOCKER_BUILDER_VERSION);
let volume_mount = format!(
"{}:/workdir",
workspace_dir.canonicalize()?.display().to_string()