-
Notifications
You must be signed in to change notification settings - Fork 1
/
footer.go
61 lines (57 loc) · 2.95 KB
/
footer.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
// cui: http request/response tui
// Copyright 2022-2023 Mario Finelli
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package main
import (
"log"
)
func setInstructions(cui *cuiApp, instr string) {
if instr == "RequestHistory" {
cui.FooterInstruction.SetText(" (esc) done (enter) load (↑/↓) navigate (d) delete)")
} else if instr == "MethodDropdown" {
cui.FooterInstruction.SetText(" (esc) cancel (enter) confirm (↑/↓) navigate")
} else if instr == "RequestKindDropdown" {
cui.FooterInstruction.SetText(" (esc) cancel (enter) confirm (↑/↓) navigate")
} else if instr == "UrlInput" {
cui.FooterInstruction.SetText(" (enter) finish entering text")
} else if instr == "ResponseBody" {
cui.FooterInstruction.SetText(" (esc) done (h/j/k/l) navigate (s) save response body to file (t) response headers")
} else if instr == "ResponseHeaders" {
cui.FooterInstruction.SetText(" (esc) done (t) response body")
} else if instr == "RequestBodyTextarea" {
cui.FooterInstruction.SetText(" (esc) done (crtl^k) set kind (ctrl^h) edit headers (ctrl^p) edit query parameters (ctrl^e) edit in $EDITOR")
} else if instr == "RequestBodyFormdata" {
cui.FooterInstruction.SetText(" TODO")
} else if instr == "RequestHeaders" {
cui.FooterInstruction.SetText(" (esc) done (↑/↓) cycle headers (a) add new header (d) delete selected header (b) edit request body (p) edit query parameters")
} else if instr == "RequestHeaderAdd" {
cui.FooterInstruction.SetText(" (esc) cancel (enter) done (tab) cycle key/value")
} else if instr == "RequestParameters" {
cui.FooterInstruction.SetText(" (esc) done (a) add query parameter (d) deleted selected parameter (b) edit request body (h) edit headers")
} else if instr == "SaveResponse" {
cui.FooterInstruction.SetText(" (esc) cancel (enter) done ")
} else if instr == "FileExists" {
cui.FooterInstruction.SetText("(!) File With this name already exists (w) replace (esc) cancel")
} else {
if instr != "" {
log.Printf("Couldn't find instructions for '%s'\n", instr)
}
if cui.ViewHasResponse {
cui.FooterInstruction.SetText(" (q) quit (enter) send request (m) set method (u) set url (e) edit request (r) focus response (h) history (c) clear")
} else {
cui.FooterInstruction.SetText(" (q) quit (enter) send request (m) set method (u) set url (e) edit request (h) history (c) clear")
}
}
}