-
Notifications
You must be signed in to change notification settings - Fork 247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow only common trigger options in multi-trigger apps #2257
Conversation
Signed-off-by: itowlson <[email protected]>
07b81d6
to
296613e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me!
} | ||
} | ||
|
||
const COMMON_FLAGS: &[&str] = &[ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we comment that these flags are common to all well-known trigger types.
for i in 0..(args.len()) { | ||
let Some(value) = args[i].to_str() else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for i in 0..(args.len()) { | |
let Some(value) = args[i].to_str() else { | |
for (i, arg) in args.iter().enumerate() { | |
let Some(value) = arg.to_str() else { |
}; | ||
if value.starts_with('-') { | ||
// Flag candidate. Is it allowed? | ||
if !is_common_flag(value) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: I would personally inline this function.
@rylev Thanks for the review - all good points. Unfortunately, as we want to land this for 2.2, I'm going to have to punt them to a tidy-up PR - sorry. Also, as I'm already looking at Option 3 (and have it working on the happy path), which would enable trigger-specific flags, tidyings to this may become moot, but we'll see how it goes. |
Alternative to #2255 to address #2251