Skip to content

Commit

Permalink
feat(api): Add Arg::get_value_terminator()
Browse files Browse the repository at this point in the history
Expose get_value_terminator() for use by clap_complete.

Related-to: clap-rs#3022
Signed-off-by: David Aguilar <davvid@gmail.com>
  • Loading branch information
davvid committed Jan 10, 2023
1 parent d0adade commit 0b0306c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/builder/arg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3858,6 +3858,13 @@ impl Arg {
self.val_delim
}

/// Get the value terminator for this argument. The value_terminator is a value
/// that terminates parsing of multi-valued arguments.
#[inline]
pub fn get_value_terminator(&self) -> Option<&Str> {
self.terminator.as_ref()
}

/// Get the index of this argument, if any
#[inline]
pub fn get_index(&self) -> Option<usize> {
Expand Down

0 comments on commit 0b0306c

Please sign in to comment.