Fix installed tool command probes
This commit is contained in:
parent
a6ab33d161
commit
4bfb0e6ea0
4 changed files with 82 additions and 1 deletions
|
|
@ -5,17 +5,40 @@ use clusterflux_core::{ProjectId, TenantId, UserId};
|
|||
use serde_json::json;
|
||||
|
||||
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
let raw_args = std::env::args().skip(1).collect::<Vec<_>>();
|
||||
match raw_args.as_slice() {
|
||||
[flag] if matches!(flag.as_str(), "--version" | "-V") => {
|
||||
println!("clusterflux-coordinator {}", env!("CARGO_PKG_VERSION"));
|
||||
return Ok(());
|
||||
}
|
||||
[flag] if matches!(flag.as_str(), "--help" | "-h") => {
|
||||
println!(
|
||||
"Clusterflux coordinator.\n\n\
|
||||
Usage: clusterflux-coordinator [OPTIONS]\n\n\
|
||||
Options:\n \
|
||||
--listen <ADDRESS> [default: 127.0.0.1:0]\n \
|
||||
--allow-local-trusted-loopback\n \
|
||||
-h, --help\n \
|
||||
-V, --version"
|
||||
);
|
||||
return Ok(());
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
|
||||
let mut listen = "127.0.0.1:0".to_owned();
|
||||
let mut allow_local_trusted = std::env::var("CLUSTERFLUX_ALLOW_LOCAL_TRUSTED_LOOPBACK")
|
||||
.ok()
|
||||
.as_deref()
|
||||
== Some("1");
|
||||
let mut args = std::env::args().skip(1);
|
||||
let mut args = raw_args.into_iter();
|
||||
while let Some(arg) = args.next() {
|
||||
if arg == "--listen" {
|
||||
listen = args.next().ok_or("--listen requires an address")?;
|
||||
} else if arg == "--allow-local-trusted-loopback" {
|
||||
allow_local_trusted = true;
|
||||
} else {
|
||||
return Err(format!("unknown argument: {arg}").into());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -36,6 +36,26 @@ use demo_backend::{LINUX_THREAD, MAIN_THREAD, PACKAGE_THREAD, WINDOWS_THREAD};
|
|||
use virtual_model::{process_id, RuntimeBackend};
|
||||
|
||||
fn main() -> Result<()> {
|
||||
let raw_args = std::env::args().skip(1).collect::<Vec<_>>();
|
||||
match raw_args.as_slice() {
|
||||
[flag] if matches!(flag.as_str(), "--version" | "-V") => {
|
||||
println!("clusterflux-debug-dap {}", env!("CARGO_PKG_VERSION"));
|
||||
return Ok(());
|
||||
}
|
||||
[flag] if matches!(flag.as_str(), "--help" | "-h") => {
|
||||
println!(
|
||||
"Clusterflux Debug Adapter Protocol server.\n\n\
|
||||
Usage: clusterflux-debug-dap\n\n\
|
||||
The adapter communicates over standard input and output.\n\n\
|
||||
Options:\n \
|
||||
-h, --help\n \
|
||||
-V, --version"
|
||||
);
|
||||
return Ok(());
|
||||
}
|
||||
[] => {}
|
||||
[argument, ..] => anyhow::bail!("unknown argument: {argument}"),
|
||||
}
|
||||
adapter::run_adapter()
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,5 +8,34 @@ mod task_artifacts;
|
|||
mod task_reports;
|
||||
|
||||
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
let raw_args = std::env::args().skip(1).collect::<Vec<_>>();
|
||||
match raw_args.as_slice() {
|
||||
[flag] if matches!(flag.as_str(), "--version" | "-V") => {
|
||||
println!("clusterflux-node {}", env!("CARGO_PKG_VERSION"));
|
||||
return Ok(());
|
||||
}
|
||||
[flag] if matches!(flag.as_str(), "--help" | "-h") => {
|
||||
println!(
|
||||
"Clusterflux node worker.\n\n\
|
||||
Usage: clusterflux-node --coordinator <URL> [OPTIONS]\n\n\
|
||||
Options:\n \
|
||||
--coordinator <URL>\n \
|
||||
--tenant <TENANT> [default: tenant]\n \
|
||||
--project-id <PROJECT> [default: project]\n \
|
||||
--node <NODE> [default: node]\n \
|
||||
--project-root <PATH>\n \
|
||||
--enrollment-grant <GRANT>\n \
|
||||
--public-key <KEY>\n \
|
||||
--worker\n \
|
||||
--emit-ready\n \
|
||||
--control-poll-ms <MILLISECONDS>\n \
|
||||
--assignment-poll-ms <MILLISECONDS> [default: 500]\n \
|
||||
-h, --help\n \
|
||||
-V, --version"
|
||||
);
|
||||
return Ok(());
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
daemon::run()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue