]> Sergey Matveev's repositories - uploader.git/blobdiff - main.go
daemontools instead of rc.d
[uploader.git] / main.go
diff --git a/main.go b/main.go
index 23a3accbe2046619267e52bebb7c6d653e8b5934..00b396e4ba9c4450ed3ba3d7518c495e9b363c12 100644 (file)
--- a/main.go
+++ b/main.go
@@ -54,11 +54,10 @@ const (
 var (
        Index = template.Must(template.New("index").Parse(`<html>
 <head><title>Upload</title></head><body>
-<pre>
 Example command line usage:
-
-    $ curl -F file=@somedata.tar.gpg [-F comment="optional comment"] http://.../upload/
-    $ b2sum -a blake2b somedata.tar.gpg # to verify checksum
+<pre>
+$ curl -F file=@somedata.tar.gpg [-F comment="optional comment"] http://.../upload/
+$ b2sum -a blake2b somedata.tar.gpg # to verify checksum
 </pre>
 <form enctype="multipart/form-data" action="/upload/" method="post">
 <label for="file">File to upload:</label><br/>
@@ -199,9 +198,11 @@ func upload(w http.ResponseWriter, r *http.Request) {
 func main() {
        bind := flag.String("bind", "[::]:8086", "Address to bind to")
        conns := flag.Int("conns", 2, "Maximal number of connections")
-       NotifyFromAddr = flag.String("notify-from", "uploader@example.com", "Address notifications are send to")
-       NotifyToAddr = flag.String("notify-to", "", "Address notifications are send from")
+       NotifyFromAddr = flag.String("notify-from", "uploader@example.com", "Address notifications are sent to")
+       NotifyToAddr = flag.String("notify-to", "", "Address notifications are sent from")
        flag.Parse()
+       log.SetFlags(log.Lshortfile)
+       log.SetOutput(os.Stdout)
        if len(*NotifyFromAddr) == 0 && len(*NotifyToAddr) > 0 {
                log.Fatalln("notify-from address can not be empty, if notify-to is set")
        }