summary refs log tree commit diff stats
path: root/cmd
diff options
context:
space:
mode:
authorAndinus <andinus@inventati.org>2020-03-15 17:16:04 +0530
committerAndinus <andinus@inventati.org>2020-03-15 17:16:04 +0530
commit3326769c24c9ba670ef0e30f90ef2957db3c149f (patch)
tree7fe55c7c402765c1d890311ff7eae0f99aa651f5 /cmd
parent16bcb7f173399c17b73469ac26d20e0d29c59e0d (diff)
downloadcetus-3326769c24c9ba670ef0e30f90ef2957db3c149f.tar.gz
Port path-only to cetus-nasa
Diffstat (limited to 'cmd')
-rw-r--r--cmd/cetus-nasa/cetus-nasa.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/cmd/cetus-nasa/cetus-nasa.go b/cmd/cetus-nasa/cetus-nasa.go
index bb7ad6a..6610bba 100644
--- a/cmd/cetus-nasa/cetus-nasa.go
+++ b/cmd/cetus-nasa/cetus-nasa.go
@@ -29,6 +29,7 @@ var (
 	quiet     bool
 	version   bool
 	fetchOnly bool
+	pathOnly  bool
 
 	api         string
 	apiKey      string
@@ -91,6 +92,7 @@ func parseFlags() {
 	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.BoolVar(&pathOnly, "path-only", false, "Print only path of the image")
 
 	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")
@@ -107,6 +109,10 @@ func printDetails(apodRes nasa.APOD) {
 	if quiet {
 		return
 	}
+	if pathOnly {
+		cetus.PrintPath(apodPhoto.HDURL)
+		return
+	}
 	fmt.Printf("Title: %s\n\n", apodRes.Title)
 	fmt.Printf("Copyright: %s\n", apodRes.Copyright)
 	fmt.Printf("Date: %s\n\n", apodRes.Date)
^
3e1349d2 ^
4690ce81 ^
a654e4ec ^

3e1349d2 ^
a654e4ec ^
3e1349d2 ^
c5ffb6e1 ^

a654e4ec ^





c5ffb6e1 ^

a654e4ec ^
c5ffb6e1 ^
c5ffb6e1 ^


3e1349d2 ^
c5ffb6e1 ^

a654e4ec ^
c5ffb6e1 ^
9570363a ^
4690ce81 ^
9570363a ^
4690ce81 ^
9570363a ^


c5ffb6e1 ^

4690ce81 ^
dcc060c7 ^



c5ffb6e1 ^

4690ce81 ^

c5ffb6e1 ^
4690ce81 ^
c5ffb6e1 ^


76755b28 ^
4690ce81 ^
76755b28 ^






dcc060c7 ^




76755b28 ^
c5ffb6e1 ^


a654e4ec ^
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