Skip to content

Commit

Permalink
Report an error if an invalid --for= argument is supplied, instead of…
Browse files Browse the repository at this point in the history
… ignoring it

Signed-off-by: Natalie Klestrup Röijezon <[email protected]>
  • Loading branch information
nightkr committed Oct 24, 2024
1 parent 3eca71f commit 5c411fc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions examples/event_watcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ async fn main() -> anyhow::Result<()> {
if let Some(forval) = app.r#for {
if let Some((kind, name)) = forval.split_once('/') {
conf = conf.fields(&format!("regarding.kind={kind},regarding.name={name}"));
} else {
return Err(anyhow::Error::msg("Usage: --for=<KIND>/<NAME>"));
}
}
let event_stream = watcher(events, conf).default_backoff().applied_objects();
Expand Down

0 comments on commit 5c411fc

Please sign in to comment.