Lint
This commit is contained in:
parent
7a5365d7f4
commit
5af95c91af
|
@ -20,30 +20,24 @@ impl Base32Config {
|
|||
|
||||
pub fn base32_encoding(config: Base32Config) -> Result<Encoding, ShellError> {
|
||||
match (config.nopad, config.dnscurve, config.dnssec) {
|
||||
(Some(nopad), Some(dnscurve), _) => {
|
||||
return Err(ShellError::IncompatibleParameters {
|
||||
left_message: "Inapplicable to DNSCURVE".to_string(),
|
||||
left_span: nopad,
|
||||
right_message: "Must be used standalone".to_string(),
|
||||
right_span: dnscurve,
|
||||
});
|
||||
}
|
||||
(_, Some(dnscurve), Some(dnssec)) => {
|
||||
return Err(ShellError::IncompatibleParameters {
|
||||
left_message: "Incompatible with DNSCURVE".to_string(),
|
||||
left_span: dnssec,
|
||||
right_message: "Must be used standalone".to_string(),
|
||||
right_span: dnscurve,
|
||||
});
|
||||
}
|
||||
(Some(nopad), _, Some(dnssec)) => {
|
||||
return Err(ShellError::IncompatibleParameters {
|
||||
left_message: "Inapplicable to DNSCURVE".to_string(),
|
||||
left_span: nopad,
|
||||
right_message: "DNSCURVE must be used standalone".to_string(),
|
||||
right_span: dnssec,
|
||||
});
|
||||
}
|
||||
(Some(nopad), Some(dnscurve), _) => Err(ShellError::IncompatibleParameters {
|
||||
left_message: "Inapplicable to DNSCURVE".to_string(),
|
||||
left_span: nopad,
|
||||
right_message: "Must be used standalone".to_string(),
|
||||
right_span: dnscurve,
|
||||
}),
|
||||
(_, Some(dnscurve), Some(dnssec)) => Err(ShellError::IncompatibleParameters {
|
||||
left_message: "Incompatible with DNSCURVE".to_string(),
|
||||
left_span: dnssec,
|
||||
right_message: "Must be used standalone".to_string(),
|
||||
right_span: dnscurve,
|
||||
}),
|
||||
(Some(nopad), _, Some(dnssec)) => Err(ShellError::IncompatibleParameters {
|
||||
left_message: "Inapplicable to DNSCURVE".to_string(),
|
||||
left_span: nopad,
|
||||
right_message: "DNSCURVE must be used standalone".to_string(),
|
||||
right_span: dnssec,
|
||||
}),
|
||||
|
||||
(None, None, None) => Ok(data_encoding::BASE32),
|
||||
(Some(_), None, None) => Ok(data_encoding::BASE32_NOPAD),
|
||||
|
|
|
@ -99,7 +99,8 @@ impl Command for EncodeBase64 {
|
|||
(Type::Binary, Type::String),
|
||||
])
|
||||
.allow_variants_without_examples(true)
|
||||
.required("encoding", SyntaxShape::String, "encoding to use")
|
||||
.switch("url", "Use the URL-safe Base64 version.", None)
|
||||
.switch("nopad", "Don't pad the output.", None)
|
||||
.category(Category::Formats)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user