cli: output full version (#170057)

Fixes #169635
This commit is contained in:
Connor Peet 2022-12-26 14:47:13 -05:00 committed by GitHub
parent 9795b2dafa
commit 84d2eac2fc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -25,12 +25,22 @@ To read output from another program, append '-' (e.g. 'echo Hello World | ",
{all-args}"
);
const COMMIT_IN_VERSION: &str = match constants::VSCODE_CLI_COMMIT {
Some(c) => c,
None => "unknown",
};
const NUMBER_IN_VERSION: &str = match constants::VSCODE_CLI_VERSION {
Some(c) => c,
None => "dev",
};
const VERSION: &str = concatcp!(NUMBER_IN_VERSION, " (commit ", COMMIT_IN_VERSION, ")");
#[derive(Parser, Debug, Default)]
#[clap(
help_template = TEMPLATE,
long_about = None,
name = CLI_NAME,
version = match constants::VSCODE_CLI_VERSION { Some(v) => v, None => "dev" },
version = VERSION,
)]
pub struct IntegratedCli {
#[clap(flatten)]
@ -62,7 +72,7 @@ pub struct CliCore {
help_template = TEMPLATE,
long_about = None,
name = CLI_NAME,
version = match constants::VSCODE_CLI_VERSION { Some(v) => v, None => "dev" },
version = VERSION,
)]
pub struct StandaloneCli {
#[clap(flatten)]