Add error for missing username on :logout (#277)
This commit is contained in:
@@ -515,6 +515,9 @@ fn iamb_open(desc: CommandDescription, ctx: &mut ProgContext) -> ProgResult {
|
||||
fn iamb_logout(desc: CommandDescription, ctx: &mut ProgContext) -> ProgResult {
|
||||
let args = desc.arg.strings()?;
|
||||
|
||||
if args.is_empty() {
|
||||
return Result::Err(CommandError::Error("Missing username".to_string()));
|
||||
}
|
||||
if args.len() != 1 {
|
||||
return Result::Err(CommandError::InvalidArgument);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user