forked from sloum/bombadillo
Fixes merge conflicts with base branch
This commit is contained in:
commit
ed084298c7
10
client.go
10
client.go
|
@ -344,7 +344,7 @@ func (c *client) simpleCommand(action string) {
|
||||||
case "SEARCH":
|
case "SEARCH":
|
||||||
c.search("", "", "?")
|
c.search("", "", "?")
|
||||||
case "HELP", "?":
|
case "HELP", "?":
|
||||||
go c.Visit(helplocation)
|
c.Visit(helplocation)
|
||||||
case "VERSION":
|
case "VERSION":
|
||||||
c.SetMessage("Bombadillo version: " + version, false)
|
c.SetMessage("Bombadillo version: " + version, false)
|
||||||
c.DrawMessage()
|
c.DrawMessage()
|
||||||
|
@ -359,6 +359,14 @@ func (c *client) doCommand(action string, values []string) {
|
||||||
case "C", "CHECK":
|
case "C", "CHECK":
|
||||||
c.displayConfigValue(values[0])
|
c.displayConfigValue(values[0])
|
||||||
c.DrawMessage()
|
c.DrawMessage()
|
||||||
|
case "HELP", "?":
|
||||||
|
if val, ok := ERRS[values[0]]; ok {
|
||||||
|
c.SetMessage("Usage: " + val, false)
|
||||||
|
} else {
|
||||||
|
msg := fmt.Sprintf("%q is not a valid command; help syntax: %s", values[0], ERRS[action])
|
||||||
|
c.SetMessage(msg, false)
|
||||||
|
}
|
||||||
|
c.DrawMessage()
|
||||||
case "PURGE", "P":
|
case "PURGE", "P":
|
||||||
err := c.Certs.Purge(values[0])
|
err := c.Certs.Purge(values[0])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -94,10 +94,10 @@ func (p *Parser) parseAction() (*Command, error) {
|
||||||
case Value:
|
case Value:
|
||||||
cm.Target = t.val
|
cm.Target = t.val
|
||||||
cm.Type = DOLINK
|
cm.Type = DOLINK
|
||||||
case Word:
|
case Word, Action:
|
||||||
cm.Value = append(cm.Value, t.val)
|
cm.Value = append(cm.Value, t.val)
|
||||||
cm.Type = DO
|
cm.Type = DO
|
||||||
case Action, Whitespace:
|
case Whitespace:
|
||||||
return nil, fmt.Errorf("Found %q (%d), expected value", t.val, t.kind)
|
return nil, fmt.Errorf("Found %q (%d), expected value", t.val, t.kind)
|
||||||
}
|
}
|
||||||
t = p.scan()
|
t = p.scan()
|
||||||
|
|
6
help.go
6
help.go
|
@ -8,7 +8,7 @@ var ERRS = map[string]string{
|
||||||
"DELETE": "`delete [bookmark-id]`",
|
"DELETE": "`delete [bookmark-id]`",
|
||||||
"B": "`b [[bookmark-id]]`",
|
"B": "`b [[bookmark-id]]`",
|
||||||
"BOOKMARKS": "`bookmarks [[bookmark-id]]`",
|
"BOOKMARKS": "`bookmarks [[bookmark-id]]`",
|
||||||
"C": "`c [link_id]` or `check [setting]`",
|
"C": "`c [link_id]` or `c [setting]`",
|
||||||
"CHECK": "`check [link_id]` or `check [setting]`",
|
"CHECK": "`check [link_id]` or `check [setting]`",
|
||||||
"H": "`h`",
|
"H": "`h`",
|
||||||
"HOME": "`home`",
|
"HOME": "`home`",
|
||||||
|
@ -23,7 +23,7 @@ var ERRS = map[string]string{
|
||||||
"SET": "`set [setting] [value]`",
|
"SET": "`set [setting] [value]`",
|
||||||
"W": "`w [target]`",
|
"W": "`w [target]`",
|
||||||
"WRITE": "`write [target]`",
|
"WRITE": "`write [target]`",
|
||||||
"?": "`?`",
|
|
||||||
"HELP": "`help`",
|
|
||||||
"VERSION": "`version`",
|
"VERSION": "`version`",
|
||||||
|
"?": "`? [[command]]`",
|
||||||
|
"HELP": "`help [[command]]`",
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,7 +33,7 @@ func Visit(webmode, url string, width int) (Page, error) {
|
||||||
return Page{}, fmt.Errorf("Invalid webmode setting")
|
return Page{}, fmt.Errorf("Invalid webmode setting")
|
||||||
}
|
}
|
||||||
c, err := exec.Command(webmode, "-dump", w, fmt.Sprintf("%d", width), url).Output()
|
c, err := exec.Command(webmode, "-dump", w, fmt.Sprintf("%d", width), url).Output()
|
||||||
if err != nil {
|
if err != nil && c == nil {
|
||||||
return Page{}, err
|
return Page{}, err
|
||||||
}
|
}
|
||||||
return parseLinks(string(c)), nil
|
return parseLinks(string(c)), nil
|
||||||
|
|
Loading…
Reference in New Issue