mirror of
https://github.com/gay-pizza/jaarg.git
synced 2025-12-19 07:20:18 +00:00
Use with chaining instead of alternative constructor to override flag characters
This commit is contained in:
@@ -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