Open aobatact opened 2 years ago
Most uses of OsStr
will be for ArgMatches
which is out of the scope of clap-serde
.
While the builder API has some parts that accept OsStr
, it would mostly be for if someone dynamically generates the value from the system, like providing std::env::current_dir
as a default. Since this can't b done with clap-serde
, there doesn't seem much value.
However, thinking of the idea I put in #33, if the deserializer was made stateful, users could provide "variables" to be used in different places.
Going back to the std::env::current_dir
idea, this could look like
let de = clap_serder::Deserialize::new()
.register("current_dir", std::env::current_dir());
let cmd = de.deserialize(serde_json::Deserializer::from_str(data);
with data
being
{
"args": [
{
"id": "input",
"default_value": { "variable": "current_dir" }
}
]
}
Do we need
OsStr
support?