forked from External/ergo
WHOWAS command
This commit is contained in:
parent
69cdad45ac
commit
b2055595e1
4 changed files with 49 additions and 0 deletions
|
|
@ -54,6 +54,7 @@ var (
|
|||
VERSION: NewVersionCommand,
|
||||
WHO: NewWhoCommand,
|
||||
WHOIS: NewWhoisCommand,
|
||||
WHOWAS: NewWhoWasCommand,
|
||||
}
|
||||
)
|
||||
|
||||
|
|
@ -968,3 +969,26 @@ func NewKillCommand(args []string) (editableCommand, error) {
|
|||
comment: args[1],
|
||||
}, nil
|
||||
}
|
||||
|
||||
type WhoWasCommand struct {
|
||||
BaseCommand
|
||||
nicknames []string
|
||||
count int64
|
||||
target string
|
||||
}
|
||||
|
||||
func NewWhoWasCommand(args []string) (editableCommand, error) {
|
||||
if len(args) < 1 {
|
||||
return nil, NotEnoughArgsError
|
||||
}
|
||||
cmd := &WhoWasCommand{
|
||||
nicknames: strings.Split(args[0], ","),
|
||||
}
|
||||
if len(args) > 1 {
|
||||
cmd.count, _ = strconv.ParseInt(args[1], 10, 64)
|
||||
}
|
||||
if len(args) > 2 {
|
||||
cmd.target = args[2]
|
||||
}
|
||||
return cmd, nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue