pastebin/cmd/pb/main.go
Tai Groot 5ade7a0642
Fix pb utility (#16)
* Update dependencies and go compile target version

* Adds deletion support to the server

* Add form around delete button

* Add support for returning the url in curl

* remove -config option for now

* Upload as form value instead of file

* remove dependencies from go mod

* update to README re: new curl usage
2021-04-20 23:20:39 +10:00

37 lines
603 B
Go

package main
import (
"log"
"os"
"github.com/prologic/pastebin/client"
"github.com/namsral/flag"
)
const (
defaultConfig = "pastebin.conf"
defaultUserConfig = "~/.pastebin.conf"
defaultURL = "http://localhost:8000"
)
func main() {
var (
url string
insecure bool
)
flag.StringVar(&url, "url", defaultURL, "pastebin service url")
flag.BoolVar(&insecure, "insecure", false, "insecure (skip ssl verify)")
flag.Parse()
cli := client.NewClient(url, insecure)
err := cli.Paste(os.Stdin)
if err != nil {
log.Printf("error posting paste: %s", err)
os.Exit(1)
}
}