|
@@ -35,6 +35,18 @@ struct Cli {
|
|
#[arg(short, long)]
|
|
#[arg(short, long)]
|
|
config: Option<PathBuf>,
|
|
config: Option<PathBuf>,
|
|
|
|
|
|
|
|
+ /// Print pen info
|
|
|
|
+ #[arg(short, long)]
|
|
|
|
+ pen: Option<Vec<usize>>,
|
|
|
|
+
|
|
|
|
+ // /// Layer of object to print info
|
|
|
|
+ // #[arg(short = 'l', long, requires = "object")]
|
|
|
|
+ // object_layer: Option<usize>,
|
|
|
|
+
|
|
|
|
+ // /// Print object info
|
|
|
|
+ // #[arg(short = 'b', long)]
|
|
|
|
+ // object: Option<usize>,
|
|
|
|
+
|
|
#[command(flatten)]
|
|
#[command(flatten)]
|
|
verbose: Verbosity<InfoLevel>,
|
|
verbose: Verbosity<InfoLevel>,
|
|
}
|
|
}
|
|
@@ -101,6 +113,43 @@ fn main() {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ // Process pen query
|
|
|
|
+ cli.pen.map(|index| {
|
|
|
|
+ for pen in index {
|
|
|
|
+ info!(
|
|
|
|
+ "Pen #{}: {}",
|
|
|
|
+ pen,
|
|
|
|
+ file.pens_offset
|
|
|
|
+ .data
|
|
|
|
+ .pens
|
|
|
|
+ .get(pen)
|
|
|
|
+ .expect("Invalid pen index")
|
|
|
|
+ );
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ // Process object query
|
|
|
|
+ // cli.object.map(|obj_index| {
|
|
|
|
+ // let layer_index: usize = cli.object_layer.unwrap_or(0);
|
|
|
|
+ // let layer: &Layer = file
|
|
|
|
+ // .layers_offset
|
|
|
|
+ // .get(layer_index)
|
|
|
|
+ // .expect("Invalid layer index");
|
|
|
|
+ // let object: &Object = layer.objects.get(obj_index).expect("Invalid object index");
|
|
|
|
+ // info!("Layer {}, Object {}: {:?}", layer_index, obj_index, object);
|
|
|
|
+ // let pen_index: u32 = object.get_pen();
|
|
|
|
+ // trace!(
|
|
|
|
+ // "Pen #{}: {}",
|
|
|
|
+ // pen_index,
|
|
|
|
+ // file.pens_offset
|
|
|
|
+ // .data
|
|
|
|
+ // .pens
|
|
|
|
+ // .get(pen_index as usize)
|
|
|
|
+ // .expect("Invalid pen index in object")
|
|
|
|
+ // );
|
|
|
|
+ // // TODO: object info
|
|
|
|
+ // });
|
|
|
|
+
|
|
// Process diff
|
|
// Process diff
|
|
cli.diff.map(|diff| {
|
|
cli.diff.map(|diff| {
|
|
info!("Processing diff file '{}'", diff.to_string_lossy());
|
|
info!("Processing diff file '{}'", diff.to_string_lossy());
|