mirror of
https://github.com/nushell/nushell.git
synced 2024-11-22 00:13:21 +01:00
add is_const to help commands
and scope commands
(#14125)
# Description This PR adds `is_const` to `help commands` and `scope commands` so we can see which commands are const commands. ![image](https://github.com/user-attachments/assets/f2269f9d-5042-40e4-b506-34d69096fcd1)
This commit is contained in:
parent
8c8f795e9e
commit
8d4426f2f8
@ -220,6 +220,7 @@ fn build_help_commands(engine_state: &EngineState, span: Span) -> Vec<Value> {
|
|||||||
"params" => param_table,
|
"params" => param_table,
|
||||||
"input_output" => input_output_table,
|
"input_output" => input_output_table,
|
||||||
"search_terms" => Value::string(search_terms.join(", "), span),
|
"search_terms" => Value::string(search_terms.join(", "), span),
|
||||||
|
"is_const" => Value::bool(decl.is_const(), span),
|
||||||
};
|
};
|
||||||
|
|
||||||
found_cmds_vec.push(Value::record(record, span));
|
found_cmds_vec.push(Value::record(record, span));
|
||||||
|
@ -113,6 +113,7 @@ impl<'e, 's> ScopeData<'e, 's> {
|
|||||||
"examples" => Value::list(examples, span),
|
"examples" => Value::list(examples, span),
|
||||||
"type" => Value::string(decl.command_type().to_string(), span),
|
"type" => Value::string(decl.command_type().to_string(), span),
|
||||||
"is_sub" => Value::bool(decl.is_sub(), span),
|
"is_sub" => Value::bool(decl.is_sub(), span),
|
||||||
|
"is_const" => Value::bool(decl.is_const(), span),
|
||||||
"creates_scope" => Value::bool(signature.creates_scope, span),
|
"creates_scope" => Value::bool(signature.creates_scope, span),
|
||||||
"extra_description" => Value::string(decl.extra_description(), span),
|
"extra_description" => Value::string(decl.extra_description(), span),
|
||||||
"search_terms" => Value::string(decl.search_terms().join(", "), span),
|
"search_terms" => Value::string(decl.search_terms().join(", "), span),
|
||||||
|
Loading…
Reference in New Issue
Block a user