Detect sections; Unify printing help across the tools

This commit is contained in:
Jaby Blubb 2023-06-25 16:38:29 +02:00
parent d342f6ebc4
commit 1f8a366b6c
9 changed files with 23 additions and 9 deletions

View File

@ -78,7 +78,12 @@
{
"id": "cargo run args",
"type": "pickString",
"options": ["", "--help", "--list -o ../Tests/Test_Planschbecken psx bin-cue ../Tests/ISO_Planschbecken.xml"],
"options": [
"",
"--help",
"--list -o ../Tests/Test_Planschbecken psx bin-cue ../Tests/ISO_Planschbecken.xml",
"${workspaceFolder}/../../examples/PoolBox/application/bin/PSX-release/PoolBox.map"
],
"default": "",
"description": "Argument options to pass to cargo run"
}

View File

@ -47,6 +47,6 @@ fn main() {
exit_with_error(error)
}
},
Err(error) => eprintln!("{}", error)
Err(error) => println!("{}", error)
}
}

View File

@ -64,6 +64,6 @@ fn main() {
exit_with_error(error);
}
},
Err(error) => eprintln!("{}", error)
Err(error) => println!("{}", error)
}
}

View File

@ -45,7 +45,7 @@ fn main() {
}
},
Err(error) => {
exit_with_error(Error::from_error(error));
println!("{}", error)
}
}
}

View File

@ -60,7 +60,7 @@ fn main() {
}
},
Err(error) => {
eprintln!("{}", error)
println!("{}", error)
}
}
}

View File

@ -1,8 +1,17 @@
pub mod types;
use tool_helper::{Error, Input};
use std::io::BufRead;
use types::Section;
pub fn scan(input: Input) -> Result<Vec<Section>, Error> {
let lines = input.lines().map(|l| l.unwrap());
for line in lines {
if line.starts_with('.') {
println!("Found section \"{}\"", line);
}
}
Err(Error::not_implemented("readmap::scan"))
}

View File

@ -25,7 +25,7 @@ pub fn main() {
}
},
Err(error) => {
exit_with_error(Error::from_error(error));
println!("{}", error)
}
}
}

View File

@ -1,6 +1,6 @@
use colored::*;
use envmnt::{ExpandOptions, ExpansionType};
use std::{boxed::Box, io::{BufReader, BufWriter, Read, Write}, path::PathBuf};
use std::{boxed::Box, io::{BufRead, BufReader, BufWriter, Read, Write}, path::PathBuf};
pub mod bits;
pub mod compress;
@ -8,7 +8,7 @@ pub mod raw;
pub type BufferedInputFile = BufReader<std::fs::File>;
pub type Output = Box<dyn Write>;
pub type Input = Box<dyn Read>;
pub type Input = Box<dyn BufRead>;
#[macro_export]
macro_rules! format_if_error {

View File

@ -13,7 +13,7 @@ fn main() {
print!("{}", wslpath::convert(cmd_line.path_string));
},
Err(error) => {
eprintln!("{}", error);
println!("{}", error);
}
}
}