We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1803ab9 commit 2ad7babCopy full SHA for 2ad7bab
cmd/polls/main.go
@@ -4,11 +4,14 @@ import (
4
"bytes"
5
"encoding/json"
6
"fmt"
7
+ "io"
8
"log"
9
"net/http"
10
"net/url"
11
"os"
12
13
+ "github.com/atotto/clipboard"
14
+
15
"github.com/tj/kingpin"
16
)
17
@@ -56,9 +59,17 @@ func main() {
56
59
log.Fatalf("error unmarshaling resonse: %s", err)
57
60
}
58
61
62
+ var buf bytes.Buffer
63
64
for _, o := range *options {
- fmt.Println(link(out.ID, o))
65
+ fmt.Fprintf(&buf, link(out.ID, o))
66
67
68
+ if err := clipboard.WriteAll(buf.String()); err == nil {
69
+ fmt.Fprintln(os.Stderr, "Copied to clipboard!")
70
+ }
71
72
+ io.Copy(os.Stdout, &buf)
73
74
75
0 commit comments