Calling un-implemented convert function
This commit is contained in:
parent
8931544f73
commit
a5512085b5
|
@ -7,6 +7,6 @@ test_cpp_out: always
|
||||||
|
|
||||||
test_jaby_engine_fconv: always
|
test_jaby_engine_fconv: always
|
||||||
@cargo build --manifest-path ../jaby_engine_fconv/Cargo.toml --release
|
@cargo build --manifest-path ../jaby_engine_fconv/Cargo.toml --release
|
||||||
@./../jaby_engine_fconv/target/release/jaby_engine_fconv --help
|
@./../jaby_engine_fconv/target/release/jaby_engine_fconv -o Test_Planschi.bin Test_PNG.PNG simple-tim full16
|
||||||
|
|
||||||
always: ;
|
always: ;
|
|
@ -1,5 +1,5 @@
|
||||||
use clap::{Args, ValueEnum};
|
use clap::{Args, ValueEnum};
|
||||||
use tool_helper::{Input, Output};
|
use tool_helper::{Error, Input, Output};
|
||||||
|
|
||||||
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, ValueEnum)]
|
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, ValueEnum)]
|
||||||
pub enum ColorDepth {
|
pub enum ColorDepth {
|
||||||
|
@ -14,6 +14,6 @@ pub struct Arguments {
|
||||||
color_depth: ColorDepth
|
color_depth: ColorDepth
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn convert(_input: Input, _output: Output) {
|
pub fn convert(_args: Arguments, _input: Input, _output: Output) -> Result<(), Error> {
|
||||||
println!("Bin ein Planschbecken!");
|
Err(Error::new("Convert not implemented yet".to_owned(), Some(-2)))
|
||||||
}
|
}
|
|
@ -20,9 +20,23 @@ enum SubCommands {
|
||||||
SimpleTIM(reduced_tim::Arguments)
|
SimpleTIM(reduced_tim::Arguments)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() {
|
fn run_main() -> tool_helper::Result<()> {
|
||||||
match CommandLine::try_parse() {
|
match CommandLine::try_parse() {
|
||||||
Ok(_cmd) => println!("Planschbecken"),
|
Ok(cmd) => {
|
||||||
Err(error) => println!("{}", error.to_string())
|
let input = tool_helper::open_input(cmd.input_file)?;
|
||||||
|
let output = tool_helper::open_output(cmd.output_file)?;
|
||||||
|
|
||||||
|
match cmd.sub_command {
|
||||||
|
SubCommands::SimpleTIM(args) => reduced_tim::convert(args, input, output),
|
||||||
|
}
|
||||||
|
},
|
||||||
|
Err(error) => Err(tool_helper::Error::new(error.to_string(), None))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
if let Err(error) = run_main() {
|
||||||
|
println!("{}", error.text);
|
||||||
|
std::process::exit(error.exit_code);
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue