Skip to content

Commit fb4fcc7

Browse files
authored
doc,comment: modified documentation comment (#42)
1 parent 6723c96 commit fb4fcc7

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/lib.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -531,9 +531,9 @@ impl<'b, 'a> Cmd<'a> {
531531
/// Returns the option argument with the specified name.
532532
///
533533
/// If the option has multiple arguments, this method returns the first argument.
534-
///
535-
/// Since the option may not be specified in the command line arguments,
536-
/// the return value of this method is an [Option] of an option argument or [None].
534+
/// If the option a boolean flag, this method returns [None].
535+
/// If the option is not specified in the command line argument, the return value
536+
/// of this method is [None].
537537
pub fn opt_arg(&'a self, name: &str) -> Option<&'a str> {
538538
if let Some(opt_vec) = self.opts.get(name) {
539539
if opt_vec.len() > 0 {
@@ -546,9 +546,9 @@ impl<'b, 'a> Cmd<'a> {
546546
/// Returns the option arguments with the specified name.
547547
///
548548
/// If the option has one or multiple arguments, this method returns an array of the arguments.
549-
///
550-
/// Since the option may not be specified in the command line arguments, the return value of
551-
/// this method is an [Option] of option arguments or [None].
549+
/// If the option a boolean flag, this method returns an empty vector.
550+
/// If the option is not specified in the command line argument, the return value
551+
/// of this method is [None].
552552
pub fn opt_args(&'a self, name: &str) -> Option<&'a [&'a str]> {
553553
match self.opts.get(name) {
554554
Some(vec) => Some(&vec),

src/parse/parse_for.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ impl<'b> Cmd<'_> {
4848
/// each option value to a curresponding field of the option store.
4949
///
5050
/// Within this method, a vector of [OptCfg] is made from the fields of the option store.
51-
/// This [OptCfg] vector is set to the public field `cfgs` of the [Cmd] instance.
52-
/// If you want to access this option configurations, get them from this field.
51+
/// This [OptCfg] vector is set into [Cmd] instance.
52+
/// If you want to access this option configurations, get them by `opt_cfgs` method.
5353
///
5454
/// An option configuration corresponding to each field of an option store is determined by
5555
/// its type and `opt` field attribute.

0 commit comments

Comments
 (0)