Compare commits

..
Author SHA1 Message Date
Chris Tate d84a769949 format 2026-01-11 23:55:29 -06:00
Chris Tate 343aa1f723 pre-commit hook 2026-01-11 23:55:13 -06:00
Chris Tate 6da48c6903 add ci action 2026-01-11 23:50:20 -06:00
2 changed files with 194 additions and 703 deletions
+186 -686
View File
File diff suppressed because it is too large Load Diff
+8 -17
View File
@@ -8,7 +8,7 @@ use serde_json::json;
use std::env;
use std::process::exit;
use commands::{gen_id, parse_command, ParseError};
use commands::{gen_id, parse_command};
use connection::{ensure_daemon, send_command};
use flags::{clean_args, parse_flags};
use install::run_install;
@@ -32,22 +32,13 @@ fn main() {
}
let cmd = match parse_command(&clean, &flags) {
Ok(c) => c,
Err(e) => {
if flags.json {
let error_type = match &e {
ParseError::UnknownCommand { .. } => "unknown_command",
ParseError::UnknownSubcommand { .. } => "unknown_subcommand",
ParseError::MissingArguments { .. } => "missing_arguments",
};
println!(
r#"{{"success":false,"error":"{}","type":"{}"}}"#,
e.format().replace('\n', " "),
error_type
);
} else {
eprintln!("\x1b[31m{}\x1b[0m", e.format());
}
Some(c) => c,
None => {
eprintln!(
"\x1b[31mUnknown command:\x1b[0m {}",
clean.get(0).unwrap_or(&String::new())
);
eprintln!("\x1b[2mRun: agent-browser --help\x1b[0m");
exit(1);
}
};