forked from extern/nushell
Split key/value in 'config set' (#2151)
This commit is contained in:
parent
e848fc0bbe
commit
1bb6a2d9ed
@ -9,7 +9,8 @@ pub struct SubCommand;
|
||||
|
||||
#[derive(Deserialize)]
|
||||
pub struct SetArgs {
|
||||
set: (Tagged<String>, Value),
|
||||
key: Tagged<String>,
|
||||
value: Value,
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
@ -19,11 +20,9 @@ impl WholeStreamCommand for SubCommand {
|
||||
}
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build("config set").required(
|
||||
"set",
|
||||
SyntaxShape::Any,
|
||||
"sets a value in the config, eg) set [key value]",
|
||||
)
|
||||
Signature::build("config set")
|
||||
.required("key", SyntaxShape::String, "variable name to set")
|
||||
.required("value", SyntaxShape::Any, "value to use")
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
@ -52,7 +51,7 @@ pub async fn set(
|
||||
registry: &CommandRegistry,
|
||||
) -> Result<OutputStream, ShellError> {
|
||||
let name_span = args.call_info.name_tag.clone();
|
||||
let (SetArgs { set: (key, value) }, _) = args.process(®istry).await?;
|
||||
let (SetArgs { key, value }, _) = args.process(®istry).await?;
|
||||
|
||||
// NOTE: None because we are not loading a new config file, we just want to read from the
|
||||
// existing config
|
||||
|
Loading…
Reference in New Issue
Block a user