Implement an option to show paths made of mkdir. (#1932)

This commit is contained in:
utam0k
2020-06-07 04:13:38 +09:00
committed by GitHub
parent ba6370621f
commit 15e66ae065
3 changed files with 39 additions and 5 deletions

View File

@ -11,6 +11,8 @@ pub struct Mkdir;
#[derive(Deserialize)]
pub struct MkdirArgs {
pub rest: Vec<Tagged<PathBuf>>,
#[serde(rename = "show-created-paths")]
pub show_created_paths: bool,
}
#[async_trait]
@ -20,7 +22,9 @@ impl WholeStreamCommand for Mkdir {
}
fn signature(&self) -> Signature {
Signature::build("mkdir").rest(SyntaxShape::Path, "the name(s) of the path(s) to create")
Signature::build("mkdir")
.rest(SyntaxShape::Path, "the name(s) of the path(s) to create")
.switch("show-created-paths", "show the path(s) created.", Some('s'))
}
fn usage(&self) -> &str {