claude_cli: hx stats lists claude's tools; unknown permissions value denies in -p
This commit is contained in:
1 parent
71f05d9a0d
commit
ddf8bcd92c
5 files changed
+85
-2
No files matched your search
@@ -90,11 +90,13 @@ pub enum Unanswered {
|
||||
}
|
||||
|
||||
impl Unanswered {
|
||||
/// Unknown values (typos) deny: this is a safety setting, failing open would hide the mistake.
|
||||
/// `ask`, `auto` and `yolo` are the interactive modes and leave `-p` as it was.
|
||||
pub fn from_config(s: Option<&str>) -> Self {
|
||||
match s {
|
||||
Some("deny") => Self::Deny,
|
||||
None | Some("ask" | "auto" | "yolo") => Self::Allow,
|
||||
Some("extensions-only") => Self::ExtensionsOnly,
|
||||
_ => Self::Allow,
|
||||
Some(_) => Self::Deny,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -339,6 +341,11 @@ mod tests {
|
||||
);
|
||||
assert_eq!(Unanswered::from_config(Some("deny")), Unanswered::Deny);
|
||||
assert_eq!(Unanswered::from_config(None), Unanswered::Allow);
|
||||
assert_eq!(Unanswered::from_config(Some("auto")), Unanswered::Allow);
|
||||
assert_eq!(
|
||||
Unanswered::from_config(Some("extrensions-only")),
|
||||
Unanswered::Deny
|
||||
);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
|
||||
Reference in new issue
Block a user