fixed usage information

This commit is contained in:
Emma Tebibyte 2023-03-24 19:42:34 -04:00
parent 088824efdf
commit 7fc82adc1c
Signed by: emma
GPG Key ID: 6D661C738815E7DD

View File

@ -107,16 +107,17 @@ fn parse_toml(
fn main() { fn main() {
let argv: Vec<String> = env::args().collect(); let argv: Vec<String> = env::args().collect();
let usage_info = format!("Usage: {} [table.]key[[index]] [file...]", argv[0]);
if argv.len() <= 1 { if argv.len() <= 1 {
eprintln!("Usage: {} [table...].[value[index]] [file...]", argv[0]); eprintln!(, argv[0]);
exit(64); // sysexits(3) EX_USAGE exit(64); // sysexits(3) EX_USAGE
} }
let input = match argv.get(2) { let input = match argv.get(2) {
Some(val) => val, Some(val) => val,
None => { None => {
eprintln!("Usage: {} [table...].[value[index]] [file...]", argv[0]); eprintln!("{}", usage_info);
exit(EX_USAGE); exit(EX_USAGE);
}, },
}; };