MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / lone_flag_is_boolean

Function lone_flag_is_boolean

nodedb/src/ctl/args.rs:104–110  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

102
103 #[test]
104 fn lone_flag_is_boolean() {
105 // A flag with no following token is treated as boolean (empty value),
106 // not an error — `--stage` in `rotate-ca --stage --data-dir /d` is
107 // the canonical example.
108 let m = parse_flags(&["--stage".into()]).unwrap();
109 assert_eq!(m.get("stage").map(|s| s.as_str()), Some(""));
110 }
111
112 #[test]
113 fn flag_followed_by_flag_is_boolean() {

Callers

nothing calls this directly

Calls 1

parse_flagsFunction · 0.85

Tested by

no test coverage detected