Allow creating modules from directories (#9066)

This commit is contained in:
Jakub Žádník
2023-05-06 21:39:54 +03:00
committed by GitHub
parent 6dc7ff2335
commit a2a346e39c
20 changed files with 1220 additions and 440 deletions

View File

@ -19,8 +19,13 @@ impl Command for Module {
fn signature(&self) -> nu_protocol::Signature {
Signature::build("module")
.input_output_types(vec![(Type::Nothing, Type::Nothing)])
.required("module_name", SyntaxShape::String, "module name")
.required("block", SyntaxShape::Block, "body of the module")
.allow_variants_without_examples(true)
.required("module", SyntaxShape::String, "module name or module path")
.optional(
"block",
SyntaxShape::Block,
"body of the module if 'module' parameter is not a module path",
)
.category(Category::Core)
}