Skip to content

Commit

Permalink
cli: output full version (#170057)
Browse files Browse the repository at this point in the history
Fixes #169635
  • Loading branch information
connor4312 authored Dec 26, 2022
1 parent 9795b2d commit 84d2eac
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions cli/src/commands/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down Expand Up @@ -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)]
Expand Down

0 comments on commit 84d2eac

Please sign in to comment.