Implement login for the fetch command (#1915)

This commit is contained in:
Tobias Tschinkowitz
2020-05-30 01:22:38 +02:00
committed by GitHub
parent 48ee20782f
commit 3a6a3d7409
4 changed files with 50 additions and 5 deletions

View File

@ -15,6 +15,18 @@ impl Plugin for Fetch {
SyntaxShape::String,
"the URL to fetch the contents from",
)
.named(
"user",
SyntaxShape::Any,
"the username when authenticating",
Some('u'),
)
.named(
"password",
SyntaxShape::Any,
"the password when authenticating",
Some('p'),
)
.switch("raw", "fetch contents as text rather than a table", Some('r'))
.filter())
}
@ -26,6 +38,8 @@ impl Plugin for Fetch {
ShellError::labeled_error("internal error: path not set", "path not set", &self.tag)
})?,
self.has_raw,
self.user.clone(),
self.password.clone(),
))])
}
}