mirror of
https://github.com/ulyssa/iamb.git
synced 2024-09-11 11:55:48 +03:00
Add error for missing username on :logout
(#277)
This commit is contained in:
parent
a18d0f54eb
commit
64e4f67e43
@ -515,6 +515,9 @@ fn iamb_open(desc: CommandDescription, ctx: &mut ProgContext) -> ProgResult {
|
|||||||
fn iamb_logout(desc: CommandDescription, ctx: &mut ProgContext) -> ProgResult {
|
fn iamb_logout(desc: CommandDescription, ctx: &mut ProgContext) -> ProgResult {
|
||||||
let args = desc.arg.strings()?;
|
let args = desc.arg.strings()?;
|
||||||
|
|
||||||
|
if args.is_empty() {
|
||||||
|
return Result::Err(CommandError::Error("Missing username".to_string()));
|
||||||
|
}
|
||||||
if args.len() != 1 {
|
if args.len() != 1 {
|
||||||
return Result::Err(CommandError::InvalidArgument);
|
return Result::Err(CommandError::InvalidArgument);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user