use std::process::ExitCode; use crate::query; use crate::repl; use crate::server; pub const USAGE: &str = " Usage: blom [command] [options] Commands: server Start the blom server. repl Start the blom repl. query Send to the blom server. help [] Print usage. General options: -h, --help Print usage. "; pub fn cmd(args: &[String]) -> ExitCode { if args.is_empty() { println!("{}", USAGE); return ExitCode::from(0); } match args[0].as_str() { "server" => println!("{}", server::USAGE), "repl" => println!("{}", repl::USAGE), "query" => println!("{}", query::USAGE), "help" => println!("{}", USAGE), _ => { println!("{}", USAGE); eprintln!("Unknown command {}.", args[0]); return ExitCode::from(1); } } ExitCode::SUCCESS }