Fix input/output cli flags for new core.os package
This commit is contained in:
+9
-6
@@ -5,11 +5,11 @@ import "core:fmt"
|
||||
import "core:os"
|
||||
|
||||
Options :: struct {
|
||||
verbose: bool `args:"name=verbose" usage:"Enable verbose output"`,
|
||||
compression: u8 `args:"name=compression" usage:"Compression level, 0-12"`,
|
||||
size: i64 `args:"name=size" usage:"Chunk size in bytes"`,
|
||||
input: os.Handle `args:"name=input,file=r,required" usage:"Path to input directory"`,
|
||||
output: os.Handle `args:"name=output,file=wc" usage:"Path to ouput directory"`,
|
||||
verbose: bool `args:"name=verbose" usage:"Enable verbose output"`,
|
||||
compression: u8 `args:"name=compression" usage:"Compression level, 0-12"`,
|
||||
size: i64 `args:"name=size" usage:"Chunk size in bytes"`,
|
||||
input: ^os.File `args:"name=input,file=r,required" usage:"Path to input directory"`,
|
||||
output: ^os.File `args:"name=output,file=wc" usage:"Path to ouput directory"`,
|
||||
// overflow: [dynamic]string,
|
||||
}
|
||||
|
||||
@@ -24,7 +24,10 @@ parse :: proc() -> Options {
|
||||
}
|
||||
|
||||
if opts.compression > 12 {
|
||||
fmt.eprintln("error: compression should be between 0-12")
|
||||
fmt.eprintln(
|
||||
"error: compression higher than allowed maximum:",
|
||||
opts.compression,
|
||||
)
|
||||
os.exit(1)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user