Skip to content

Commit 424a243

Browse files
authored
Merge pull request #5811 from epage/notes
docs: Highlight notes/warnings in a block
2 parents c54ffa1 + 6f78e2a commit 424a243

File tree

20 files changed

+686
-42
lines changed

20 files changed

+686
-42
lines changed

clap_builder/src/builder/action.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,14 @@ use crate::util::AnyValueId;
3232
pub enum ArgAction {
3333
/// When encountered, store the associated value(s) in [`ArgMatches`][crate::ArgMatches]
3434
///
35+
/// <div class="warning">
36+
///
3537
/// **NOTE:** If the argument has previously been seen, it will result in a
3638
/// [`ArgumentConflict`][crate::error::ErrorKind::ArgumentConflict] unless
3739
/// [`Command::args_override_self(true)`][crate::Command::args_override_self] is set.
3840
///
41+
/// </div>
42+
///
3943
/// # Examples
4044
///
4145
/// ```rust
@@ -87,10 +91,14 @@ pub enum ArgAction {
8791
/// No value is allowed. To optionally accept a value, see
8892
/// [`Arg::default_missing_value`][super::Arg::default_missing_value]
8993
///
94+
/// <div class="warning">
95+
///
9096
/// **NOTE:** If the argument has previously been seen, it will result in a
9197
/// [`ArgumentConflict`][crate::error::ErrorKind::ArgumentConflict] unless
9298
/// [`Command::args_override_self(true)`][crate::Command::args_override_self] is set.
9399
///
100+
/// </div>
101+
///
94102
/// # Examples
95103
///
96104
/// ```rust
@@ -162,10 +170,14 @@ pub enum ArgAction {
162170
/// No value is allowed. To optionally accept a value, see
163171
/// [`Arg::default_missing_value`][super::Arg::default_missing_value]
164172
///
173+
/// <div class="warning">
174+
///
165175
/// **NOTE:** If the argument has previously been seen, it will result in a
166176
/// [`ArgumentConflict`][crate::error::ErrorKind::ArgumentConflict] unless
167177
/// [`Command::args_override_self(true)`][crate::Command::args_override_self] is set.
168178
///
179+
/// </div>
180+
///
169181
/// # Examples
170182
///
171183
/// ```rust

clap_builder/src/builder/app_settings.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,13 @@ impl std::ops::BitOr for AppFlags {
3535

3636
/// Application level settings, which affect how [`Command`] operates
3737
///
38+
/// <div class="warning">
39+
///
3840
/// **NOTE:** When these settings are used, they apply only to current command, and are *not*
3941
/// propagated down or up through child or parent subcommands
4042
///
43+
/// </div>
44+
///
4145
/// [`Command`]: crate::Command
4246
#[derive(Debug, PartialEq, Copy, Clone)]
4347
#[repr(u8)]

0 commit comments

Comments
 (0)