- let announce_channel = match words.next() {
- Some("--public") | Some("--public=true") => true,
- Some("--public=false") => false,
- Some(_) => {
- println!("ERROR: invalid `--public` command format. Valid formats: `--public`, `--public=true` `--public=false`");
- continue;
+ let (mut announce_channel, mut with_anchors) = (false, false);
+ while let Some(word) = words.next() {
+ match word {
+ "--public" | "--public=true" => announce_channel = true,
+ "--public=false" => announce_channel = false,
+ "--with-anchors" | "--with-anchors=true" => with_anchors = true,
+ "--with-anchors=false" => with_anchors = false,
+ _ => {
+ println!("ERROR: invalid boolean flag format. Valid formats: `--option`, `--option=true` `--option=false`");
+ continue;
+ }