38 lines
902 B
Rust
38 lines
902 B
Rust
use std::path::PathBuf;
|
|
use structopt::StructOpt;
|
|
|
|
#[derive(StructOpt)]
|
|
#[structopt()]
|
|
/// Polygon Art command line interface
|
|
pub struct Opt {
|
|
/// Output file (will be a png if you don't use the --svg flag)
|
|
#[structopt(short, long, parse(from_os_str))]
|
|
pub output: PathBuf,
|
|
|
|
/// define width in pixels
|
|
#[structopt(long, default_value = "400")]
|
|
pub width: i32,
|
|
|
|
/// define height in pixels
|
|
#[structopt(long, default_value = "400")]
|
|
pub height: i32,
|
|
|
|
/// define line size in pixels, all lines will be this thick
|
|
#[structopt(long, default_value = "1.0")]
|
|
pub line_size: f64,
|
|
|
|
/// output file format should be svg instead of png
|
|
#[structopt(long)]
|
|
pub svg: bool,
|
|
|
|
/// seed for randomizer
|
|
#[structopt(long)]
|
|
pub random_seed: Option<u64>,
|
|
}
|
|
|
|
impl Opt {
|
|
pub fn get_command_line_arguments() -> Self {
|
|
Opt::from_args()
|
|
}
|
|
}
|