We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a126391 commit 3f410c8Copy full SHA for 3f410c8
main.go
@@ -10,6 +10,7 @@ import (
10
"syscall"
11
"time"
12
13
+ "github.com/monochromegane/terminal"
14
"github.com/rs/jplot/data"
15
"github.com/rs/jplot/graph"
16
"github.com/rs/jplot/osc"
@@ -44,15 +45,22 @@ func main() {
44
45
fatal("screen and tmux not supported")
46
}
47
48
+ if len(flag.Args()) == 0 {
49
+ flag.Usage()
50
+ os.Exit(1)
51
+ }
52
+
53
specs, err := data.ParseSpec(flag.Args())
54
if err != nil {
55
fatal("Cannot parse spec: ", err)
56
57
var dp *data.Points
58
if *url != "" {
59
dp = data.FromHTTP(*url, *interval, *steps)
- } else {
60
+ } else if !terminal.IsTerminal(os.Stdin) {
61
dp = data.FromStdin(*steps)
62
+ } else {
63
+ fatal("neither --url nor stdin is provided")
64
65
dash := graph.Dash{
66
Specs: specs,
0 commit comments