mirror of
https://code.dumpstack.io/tools/wi.git
synced 2024-11-22 19:13:01 +00:00
Add post query skeleton
This commit is contained in:
parent
4a4d10c760
commit
0e256f04a6
@ -139,6 +139,10 @@ func Get(db *sql.DB, linkUrl string) {
|
||||
fmt.Println(text)
|
||||
}
|
||||
|
||||
func Post(db *sql.DB, formID int64, formArgs []string) {
|
||||
fmt.Println("Not implemented")
|
||||
}
|
||||
|
||||
func Link(db *sql.DB, linkID int64, fromHistory bool) {
|
||||
|
||||
var linkUrl string
|
||||
|
6
main.go
6
main.go
@ -42,6 +42,10 @@ var (
|
||||
get = kingpin.Command("get", "Get url")
|
||||
getUrl = get.Arg("url", "Url").Required().String()
|
||||
|
||||
post = kingpin.Command("post", "Fill post form")
|
||||
postID = post.Arg("id", "Form ID").Required().Int64()
|
||||
postArgs = SearchList(post.Arg("args", "Post form arguments"))
|
||||
|
||||
link = kingpin.Command("link", "Get link")
|
||||
linkNo = link.Arg("no", "Number").Required().Int64()
|
||||
linkFromHistory = link.Flag("history", "Item from history").Bool()
|
||||
@ -64,6 +68,8 @@ func main() {
|
||||
switch kingpin.Parse() {
|
||||
case "get":
|
||||
commands.Get(db, *getUrl)
|
||||
case "post":
|
||||
commands.Post(db, *postID, *postArgs)
|
||||
case "link":
|
||||
commands.Link(db, *linkNo, *linkFromHistory)
|
||||
case "history":
|
||||
|
Loading…
Reference in New Issue
Block a user