mirror of
https://github.com/youwen5/iamb.git
synced 2025-06-20 05:39:52 -07:00
Add error for missing username on :logout
(#277)
This commit is contained in:
parent
a18d0f54eb
commit
64e4f67e43
1 changed files with 3 additions and 0 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue