mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 17:45:03 +02:00
Implement login for the fetch command (#1915)
This commit is contained in:
committed by
GitHub
parent
48ee20782f
commit
3a6a3d7409
@ -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(),
|
||||
))])
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user