Version output for 4 unix_int tools ()

This commit is contained in:
cuberoot74088 2023-03-01 01:10:31 +01:00 committed by GitHub
parent 3378717d5a
commit f1c9e92f93
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 32 additions and 0 deletions

View file

@ -28,6 +28,10 @@ async fn main() {
if opt.debug {
::std::env::set_var("RUST_LOG", "kanidm=debug,kanidm_client=debug");
}
if opt.version {
println!("{}", kanidm_proto::utils::get_version("kanidm_cache_clear"));
std::process::exit(0);
}
sketching::tracing_subscriber::fmt::init();
debug!("Starting cache invalidate tool ...");

View file

@ -28,6 +28,10 @@ async fn main() {
if opt.debug {
::std::env::set_var("RUST_LOG", "kanidm=debug,kanidm_client=debug");
}
if opt.version {
println!("{}", kanidm_proto::utils::get_version("kanidm_cache_invalidate"));
std::process::exit(0);
}
sketching::tracing_subscriber::fmt::init();
debug!("Starting cache invalidate tool ...");

View file

@ -29,6 +29,10 @@ fn main() {
if opt.debug {
::std::env::set_var("RUST_LOG", "kanidm=debug,kanidm_client=debug");
}
if opt.version {
println!("{}", kanidm_proto::utils::get_version("kanidm_unixd_status"));
std::process::exit(0);
}
sketching::tracing_subscriber::fmt::init();
trace!("Starting cache status tool ...");

View file

@ -2,6 +2,8 @@
struct CacheClearOpt {
#[clap(short, long)]
debug: bool,
#[clap(short, long, action = clap::ArgAction::SetTrue)]
version: bool,
#[clap(long)]
really: bool,
}

View file

@ -2,4 +2,6 @@
struct CacheInvalidateOpt {
#[clap(short, long)]
debug: bool,
#[clap(short, long, action = clap::ArgAction::SetTrue)]
version: bool,
}

View file

@ -4,4 +4,6 @@ struct SshAuthorizedOpt {
debug: bool,
#[clap()]
account_id: String,
#[clap(short, long, action = clap::ArgAction::SetTrue)]
version: bool,
}

View file

@ -2,4 +2,6 @@
struct UnixdStatusOpt {
#[clap(short, long)]
debug: bool,
#[clap(short, long, action = clap::ArgAction::SetTrue)]
version: bool,
}

View file

@ -30,6 +30,10 @@ async fn main() {
if opt.debug {
::std::env::set_var("RUST_LOG", "kanidm=debug,kanidm_client=debug");
}
if opt.version {
println!("{}", kanidm_proto::utils::get_version("kanidm_ssh_authorizedkeys"));
std::process::exit(0);
}
sketching::tracing_subscriber::fmt::init();
debug!("Starting authorized keys tool ...");

View file

@ -48,6 +48,7 @@ impl OrcaOpt {
OrcaOpt::PreProc(opt) => opt.copt.debug,
OrcaOpt::Setup(opt) => opt.copt.debug,
OrcaOpt::Run(opt) => opt.copt.debug,
OrcaOpt::Version(opt) => opt.debug,
}
}
}
@ -231,6 +232,10 @@ async fn main() {
info!("Orca - the Kanidm Load Testing Utility.");
debug!("cli -> {:?}", opt);
match opt {
OrcaOpt::Version(_opt) => {
println!("{}", kanidm_proto::utils::get_version("orca"));
std::process::exit(0);
}
OrcaOpt::TestConnection(opt) => {
let _ = conntest(&opt.target, &opt.profile_path).await;
}

View file

@ -148,4 +148,7 @@ enum OrcaOpt {
#[clap(name = "run")]
/// Run the load test as defined by the test profile
Run(RunOpt),
#[clap(name = "version")]
/// Print version info and exit
Version(CommonOpt)
}