diff --git a/README.md b/README.md index fbb61b4..609244f 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,14 @@ # incfunc -Incrementally Draw derivation function of deriviation function of function \ No newline at end of file +Incrementally Draw derivation function of deriviation function of function + +## Usage + +Usage: incfunc [OPTIONS] + +Options: + -o Optimization level [default: 3] + -c Number of cores [default: max] + --unsafe-mode Unsave mode (Advanced) + -h, --help Print help + diff --git a/grid_image.png b/grid_image.png index 79f4b39..68deef5 100644 Binary files a/grid_image.png and b/grid_image.png differ diff --git a/src/main.rs b/src/main.rs index b6ea47d..c33c0f2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -15,7 +15,11 @@ struct Args { /// Number of cores [default: max] #[arg(short, value_name = "CORES")] - core: Option + core: Option, + + /// Unsave mode (Advanced) + #[arg(long, default_value_t = false)] + unsafe_mode: bool } @@ -34,6 +38,13 @@ fn main() { // // points.push(-(i as f64 / 10000.0)); // } + if args.opt_level > 8 { + if ! args.unsafe_mode { + panic!("WARNING: This will use at least 30GB RAM\nMake sure you want to use this, then enable save mode"); + } else { + println!("WARNING: This will use at least 30GB RAM\nMake sure you want to use this"); + } + } let mut step = "0.".to_string(); for _ in 0..args.opt_level { step.push('0')