mirror of
https://github.com/uqbar-dao/nectar.git
synced 2024-12-23 00:21:38 +03:00
usage strings added to scripts
This commit is contained in:
parent
c58f010af7
commit
3471951ac7
@ -29,6 +29,12 @@ fn init(_our: Address) {
|
||||
};
|
||||
|
||||
let line = String::from_utf8(args).unwrap_or("alias: error".into());
|
||||
if line.is_empty() {
|
||||
println!("Change alias for a process");
|
||||
println!("\x1b[1mUsage:\x1b[0m alias <alias_name> <process_id>");
|
||||
return;
|
||||
}
|
||||
|
||||
let (alias, process) = line.split_once(" ").unwrap_or((&line, ""));
|
||||
|
||||
if alias.is_empty() {
|
||||
|
@ -19,10 +19,16 @@ fn init(_our: Address) {
|
||||
};
|
||||
|
||||
let Ok(file_path) = String::from_utf8(args) else {
|
||||
println!("bad file path");
|
||||
println!("cat: bad args, aborting");
|
||||
return;
|
||||
};
|
||||
|
||||
if file_path.is_empty() {
|
||||
println!("Print the contents of a file to the terminal");
|
||||
println!("\x1b[1mUsage:\x1b[0m cat <file_path>");
|
||||
return;
|
||||
}
|
||||
|
||||
Request::new()
|
||||
.target(("our", "vfs", "distro", "sys"))
|
||||
.body(
|
||||
|
@ -19,6 +19,11 @@ fn init(our: Address) {
|
||||
};
|
||||
|
||||
let tail = String::from_utf8(args).unwrap();
|
||||
if tail.is_empty() {
|
||||
println!("Send a Message to another node's terminal");
|
||||
println!("\x1b[1mUsage:\x1b[0m hi <node_id> <message>");
|
||||
return;
|
||||
}
|
||||
|
||||
let (node_id, message) = match tail.split_once(" ") {
|
||||
Some((s, t)) => (s, t),
|
||||
|
@ -18,6 +18,11 @@ fn init(_our: Address) {
|
||||
return;
|
||||
};
|
||||
let body_string = String::from_utf8(body).unwrap();
|
||||
if body_string.is_empty() {
|
||||
println!("Send a Request to a Process");
|
||||
println!("\x1b[1mUsage:\x1b[0m m <target> <body> [-a <await_time>]");
|
||||
return;
|
||||
}
|
||||
|
||||
let re = Regex::new(r#"'[^']*'|\S+"#).unwrap();
|
||||
let mut args: Vec<String> = re
|
||||
|
Loading…
Reference in New Issue
Block a user