summary refs log tree commit diff stats
path: root/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'cmd')
-rw-r--r--cmd/cetus-nasa/cetus-nasa.go33
1 files changed, 21 insertions, 12 deletions
diff --git a/cmd/cetus-nasa/cetus-nasa.go b/cmd/cetus-nasa/cetus-nasa.go
index 96b83fc..7eb80c2 100644
--- a/cmd/cetus-nasa/cetus-nasa.go
+++ b/cmd/cetus-nasa/cetus-nasa.go
@@ -20,12 +20,14 @@ import (
 	"log"
 	"time"
 
-	"framagit.org/andinus/cetus/pkg"
+	"framagit.org/andinus/cetus/pkg/background"
+	"framagit.org/andinus/cetus/pkg/cetus"
 	"framagit.org/andinus/cetus/pkg/nasa"
 )
 
 var (
 	quiet     bool
+	version   bool
 	fetchOnly bool
 
 	api         string
@@ -38,19 +40,13 @@ var (
 )
 
 func main() {
-	var (
-		picturePath string
-		apodRes     nasa.APOD
-		err         error
-		apodInfo    map[string]string
-	)
-
-	dateHelp = fmt.Sprintf("Choose a random date between 1995-06-16 & %s",
-		time.Now().UTC().Format("2006-01-02"))
-	dateDefault = time.Now().UTC().Format("2006-01-02")
-
 	parseFlags()
 
+	if version {
+		cetus.Version()
+		return
+	}
+
 	// Convert timeout to seconds
 	timeout = timeout * time.Second
 
@@ -58,6 +54,13 @@ func main() {
 		date = nasa.RandDate()
 	}
 
+	var (
+		picturePath string
+		apodRes     nasa.APOD
+		err         error
+		apodInfo    map[string]string
+	)
+
 	apodInfo = make(map[string]string)
 	apodInfo["api"] = api
 	apodInfo["apiKey"] = apiKey
@@ -92,11 +95,17 @@ func main() {
 
 func parseFlags() {
 	flag.BoolVar(&quiet, "quiet", false, "No output")
+	flag.BoolVar(&version, "version", false, "Cetus version")
 	flag.BoolVar(&fetchOnly, "fetch-only", false, "Don't set background, only fetch info")
+
+	dateHelp = fmt.Sprintf("Choose a random date between 1995-06-16 & %s",
+		time.Now().UTC().Format("2006-01-02"))
 	flag.BoolVar(&random, "random", false, dateHelp)
 
 	flag.StringVar(&api, "api", "https://api.nasa.gov/planetary/apod", "APOD API URL")
 	flag.StringVar(&apiKey, "api-key", "DEMO_KEY", "api.nasa.gov key for expanded usage")
+
+	dateDefault = time.Now().UTC().Format("2006-01-02")
 	flag.StringVar(&date, "date", dateDefault, "Date of the APOD image to retrieve")
 
 	flag.DurationVar(&timeout, "timeout", 32*time.Second, "Timeout for http client in seconds")
ef='/akkartik/mu/blame/012transform.cc?h=main&id=30277d2e370210b17099387abf03e75199340e98'>^
37e4573b ^

d8509b41 ^
37e4573b ^



1ec3eb4c ^



5a481085 ^
215365d4 ^




5a481085 ^

215365d4 ^

1ec3eb4c ^
215365d4 ^
37e4573b ^
dd2e01e4 ^
6c96a437 ^

37e4573b ^
37e4573b ^
91abd257 ^
363be37f ^
37e4573b ^


3ba63579 ^
7cca03bd ^
3ba63579 ^

7858a06a ^











3ba63579 ^
dd2e01e4 ^
6c96a437 ^
3ba63579 ^

6c96a437 ^
05d17773 ^
6c96a437 ^
05d17773 ^
3ba63579 ^
6c96a437 ^
05d17773 ^
3ba63579 ^





9cc16d04 ^
7f73795c ^
0f125d5f ^

37e4573b ^
a70ce311 ^





1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101