Skip to content

Commit

Permalink
feat: Child options and flags imply their parent
Browse files Browse the repository at this point in the history
Currently only relevant for `german`
  • Loading branch information
alexpovel committed Oct 3, 2023
1 parent 92e437a commit 20518c2
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,13 @@ mod cli {
///
/// Words require correct spelling to be detected.
#[cfg(feature = "german")]
#[arg(short, long, verbatim_doc_comment)]
#[arg(
short,
long,
verbatim_doc_comment,
// `true` as string is very ugly, but there's no other way?
default_value_if("german-opts", ArgPredicate::IsPresent, "true")
)]
pub german: bool,
/// Perform substitutions on symbols, such as '!=' to '≠', '->' to '→'
///
Expand Down Expand Up @@ -446,7 +452,7 @@ mod cli {

#[cfg(feature = "german")]
#[derive(Parser, Debug)]
#[group(required = false, multiple = true)]
#[group(required = false, multiple = true, id("german-opts"))]
#[command(next_help_heading = "Options (german)")]
pub(super) struct GermanStageOptions {
/// When some original version and its replacement are equally legal, prefer the
Expand Down

0 comments on commit 20518c2

Please sign in to comment.