forked from sloum/bombadillo
Corrected several issues identified during review
This commit is contained in:
parent
86ba01b1d9
commit
7dc68a18bf
|
@ -407,9 +407,6 @@ func (c *client) doCommand(action string, values []string) {
|
|||
|
||||
func (c *client) doCommandAs(action string, values []string) {
|
||||
switch action {
|
||||
case "C", "CHECK":
|
||||
c.displayConfigValue(values[0])
|
||||
c.DrawMessage()
|
||||
case "ADD", "A":
|
||||
if len(values) < 2 {
|
||||
c.SetMessage(syntaxErrorMessage(action), true)
|
||||
|
@ -502,9 +499,6 @@ func (c *client) doLinkCommandAs(action, target string, values []string) {
|
|||
}
|
||||
|
||||
switch action {
|
||||
case "C", "CHECK":
|
||||
c.displayConfigValue(values[0])
|
||||
c.DrawMessage()
|
||||
case "ADD", "A":
|
||||
bm := make([]string, 0, 5)
|
||||
bm = append(bm, links[num])
|
||||
|
|
|
@ -94,10 +94,10 @@ func (p *Parser) parseAction() (*Command, error) {
|
|||
case Value:
|
||||
cm.Target = t.val
|
||||
cm.Type = DOLINK
|
||||
case Word, Action:
|
||||
case Word:
|
||||
cm.Value = append(cm.Value, t.val)
|
||||
cm.Type = DO
|
||||
case Whitespace:
|
||||
case Action, Whitespace:
|
||||
return nil, fmt.Errorf("Found %q (%d), expected value", t.val, t.kind)
|
||||
}
|
||||
t = p.scan()
|
||||
|
|
Loading…
Reference in New Issue