mirror of
https://github.com/gay-pizza/jaarg.git
synced 2026-11-04 10:42:20 +00:00
Use with chaining instead of alternative constructor to override flag characters
This commit is contained in:
1 parent
e496a8063d
commit
bf10fbc0a4
1 file changed
+5
-3
+5
-3
@@ -16,8 +16,10 @@ impl<ID: 'static> Opts<ID> {
|
||||
pub const fn new(options: &'static[Opt<ID>]) -> Self {
|
||||
Self { flag_chars: "-", options }
|
||||
}
|
||||
// TODO: Replace with a parser options construct
|
||||
pub const fn new_flag(flag_chars: &'static str, options: &'static[Opt<ID>]) -> Self {
|
||||
Self { flag_chars, options }
|
||||
|
||||
/// Set the recognised flag/option characters.
|
||||
pub const fn with_flag_chars(mut self, flag_chars: &'static str) -> Self {
|
||||
self.flag_chars = flag_chars;
|
||||
self
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user