Skip to content

Commit

Permalink
docs: Highlight notes/warnings in a block
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Nov 8, 2024
1 parent c54ffa1 commit d74f419
Show file tree
Hide file tree
Showing 20 changed files with 686 additions and 42 deletions.
12 changes: 12 additions & 0 deletions clap_builder/src/builder/action.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,14 @@ use crate::util::AnyValueId;
pub enum ArgAction {
/// When encountered, store the associated value(s) in [`ArgMatches`][crate::ArgMatches]
///
/// <div class="warning">
///
/// **NOTE:** If the argument has previously been seen, it will result in a
/// [`ArgumentConflict`][crate::error::ErrorKind::ArgumentConflict] unless
/// [`Command::args_override_self(true)`][crate::Command::args_override_self] is set.
///
/// </div>
///
/// # Examples
///
/// ```rust
Expand Down Expand Up @@ -87,10 +91,14 @@ pub enum ArgAction {
/// No value is allowed. To optionally accept a value, see
/// [`Arg::default_missing_value`][super::Arg::default_missing_value]
///
/// <div class="warning">
///
/// **NOTE:** If the argument has previously been seen, it will result in a
/// [`ArgumentConflict`][crate::error::ErrorKind::ArgumentConflict] unless
/// [`Command::args_override_self(true)`][crate::Command::args_override_self] is set.
///
/// </div>
///
/// # Examples
///
/// ```rust
Expand Down Expand Up @@ -162,10 +170,14 @@ pub enum ArgAction {
/// No value is allowed. To optionally accept a value, see
/// [`Arg::default_missing_value`][super::Arg::default_missing_value]
///
/// <div class="warning">
///
/// **NOTE:** If the argument has previously been seen, it will result in a
/// [`ArgumentConflict`][crate::error::ErrorKind::ArgumentConflict] unless
/// [`Command::args_override_self(true)`][crate::Command::args_override_self] is set.
///
/// </div>
///
/// # Examples
///
/// ```rust
Expand Down
4 changes: 4 additions & 0 deletions clap_builder/src/builder/app_settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,13 @@ impl std::ops::BitOr for AppFlags {

/// Application level settings, which affect how [`Command`] operates
///
/// <div class="warning">
///
/// **NOTE:** When these settings are used, they apply only to current command, and are *not*
/// propagated down or up through child or parent subcommands
///
/// </div>
///
/// [`Command`]: crate::Command
#[derive(Debug, PartialEq, Copy, Clone)]
#[repr(u8)]
Expand Down
Loading

0 comments on commit d74f419

Please sign in to comment.