Skip to content

Commit

Permalink
Work around help order bug in clap
Browse files Browse the repository at this point in the history
Rename with_lines => lines_enabled to work around the fact clap orders
by struct field name instead of actual option short/long name.
clap-rs/clap#2059
  • Loading branch information
djeedai committed Dec 6, 2020
1 parent 8f2d0c9 commit 1e44715
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions bin/weldr/src/convert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pub(crate) struct ConvertCommand {

/// Output line segments in addition of surfaces (triangles/quads).
#[structopt(long = "lines", short = "l", takes_value = false)]
with_lines: bool,
lines_enabled: bool,

/// Add the given location to the list of search paths for resolving parts.
///
Expand Down Expand Up @@ -294,14 +294,14 @@ impl Action for ConvertCommand {
debug!(" cmd: {:?}", cmd);
match cmd {
Command::Line(l) => {
if self.with_lines {
if self.lines_enabled {
geometry_cache.add_line(&draw_ctx, &l.vertices)
}
}
Command::Triangle(t) => geometry_cache.add_triangle(&draw_ctx, &t.vertices),
Command::Quad(q) => geometry_cache.add_quad(&draw_ctx, &q.vertices),
Command::OptLine(l) => {
if self.with_lines {
if self.lines_enabled {
geometry_cache.add_line(&draw_ctx, &l.vertices)
}
}
Expand Down Expand Up @@ -339,7 +339,7 @@ mod tests {
format: ConvertFormat::Gltf,
input: PathBuf::new(),
output: None,
with_lines: false,
lines_enabled: false,
include_paths: None,
catalog_path: None,
};
Expand Down

0 comments on commit 1e44715

Please sign in to comment.