Skip to content

Commit 387fd12

Browse files
Attach a note about the first element of an iterator
1 parent e82709b commit 387fd12

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/lib.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1088,6 +1088,11 @@ pub trait StructOpt {
10881088

10891089
/// Gets the struct from any iterator such as a `Vec` of your making.
10901090
/// Print the error message and quit the program in case of failure.
1091+
///
1092+
/// **NOTE**: The first argument will be parsed as the binary name unless
1093+
/// [`AppSettings::NoBinaryName`] has been used.
1094+
///
1095+
/// [`AppSettings::NoBinaryName`]: https://docs.rs/clap/2.33.0/clap/enum.AppSettings.html#variant.NoBinaryName
10911096
fn from_iter<I>(iter: I) -> Self
10921097
where
10931098
Self: Sized,
@@ -1102,6 +1107,11 @@ pub trait StructOpt {
11021107
/// Returns a `clap::Error` in case of failure. This does *not* exit in the
11031108
/// case of `--help` or `--version`, to achieve the same behavior as
11041109
/// `from_iter()` you must call `.exit()` on the error value.
1110+
///
1111+
/// **NOTE**: The first argument will be parsed as the binary name unless
1112+
/// [`AppSettings::NoBinaryName`] has been used.
1113+
///
1114+
/// [`AppSettings::NoBinaryName`]: https://docs.rs/clap/2.33.0/clap/enum.AppSettings.html#variant.NoBinaryName
11051115
fn from_iter_safe<I>(iter: I) -> Result<Self, clap::Error>
11061116
where
11071117
Self: Sized,

0 commit comments

Comments
 (0)