MCPcopy Create free account
hub / github.com/aeroxy/chrome-devtools-cli / looks_like_arg_key

Function looks_like_arg_key

src/lib.rs:486–490  ·  view source on GitHub ↗

True for strings that look like an intentional `key=value` key (e.g. `limit`, `safeSearch`, `second_arg`) rather than a positional value that merely contains a literal `=`, like a URL query string (`https://x.com?q=rust`).

(k: &str)

Source from the content-addressed store, hash-verified

484/// `safeSearch`, `second_arg`) rather than a positional value that merely
485/// contains a literal `=`, like a URL query string (`https://x.com?q=rust`).
486fn looks_like_arg_key(k: &str) -> bool {
487 let mut chars = k.chars();
488 matches!(chars.next(), Some(c) if c.is_ascii_alphabetic() || c == '_')
489 && chars.all(|c| c.is_ascii_alphanumeric() || c == '_')
490}
491
492/// Split a `key=value` argument, trim both sides, and parse the value into
493/// JSON. Shared by the `named_args` and `raw_args` loops in [`parse_args`].

Callers 1

parse_argsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected