summary refs log tree commit diff stats
path: root/cmd
diff options
context:
space:
mode:
authorAndinus <andinus@inventati.org>2020-03-15 13:35:59 +0530
committerAndinus <andinus@inventati.org>2020-03-15 13:35:59 +0530
commitd282ab6f0e7bcbb5dde2c5dd0ff0d2a59aea7fe5 (patch)
treef5b47e42f1bd04ab1884b61d5a7a9b143361972b /cmd
parentc1e489fbd281698b262d3114b08f875b1ff3b966 (diff)
downloadcetus-d282ab6f0e7bcbb5dde2c5dd0ff0d2a59aea7fe5.tar.gz
Clean up repeat variable declaration
Diffstat (limited to 'cmd')
-rw-r--r--cmd/cetus-nasa/cetus-nasa.go18
1 files changed, 5 insertions, 13 deletions
diff --git a/cmd/cetus-nasa/cetus-nasa.go b/cmd/cetus-nasa/cetus-nasa.go
index 801a89f..bb7ad6a 100644
--- a/cmd/cetus-nasa/cetus-nasa.go
+++ b/cmd/cetus-nasa/cetus-nasa.go
@@ -37,6 +37,9 @@ var (
 	dateHelp    string
 	dateDefault string
 	timeout     time.Duration
+
+	err     error
+	apodRes nasa.APOD
 )
 
 func main() {
@@ -54,12 +57,6 @@ func main() {
 		date = nasa.RandDate()
 	}
 
-	var (
-		picturePath string
-		apodRes     nasa.APOD
-		err         error
-	)
-
 	// get response from api
 	apodRes, err = getAPODRes()
 	if err != nil {
@@ -75,11 +72,10 @@ func main() {
 	if fetchOnly {
 		return
 	}
-	picturePath = apodRes.HDURL
 
 	// if media type is an image then set background
 	if apodRes.MediaType == "image" {
-		err = background.Set(picturePath)
+		err = background.Set(apodRes.HDURL)
 		if err != nil {
 			log.Fatal(err)
 		}
@@ -124,11 +120,7 @@ func printDetails(apodRes nasa.APOD) {
 }
 
 func getAPODRes() (nasa.APOD, error) {
-	var (
-		apodRes  nasa.APOD
-		err      error
-		apodInfo map[string]string
-	)
+	var apodInfo map[string]string
 	apodInfo = make(map[string]string)
 	apodInfo["api"] = api
 	apodInfo["apiKey"] = apiKey
ngle */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
0.5.0
=====

- Build against libmesode if available
- Handle invalid SSL certificates (requires libmesode)
- TLS indicator in titlebar
- Allow auto extended away
- Include last acitvity in initial presence (xep-0256)
- Last Activity (xep-0012)
- Run command sequence with /script
- Account startscript property
- Export roster to CSV file with /export
- User specified text triggers for chat room notifications
- Per chat room notification options

0.4.7
=====

- GNU Readline
- OpenPGP support
- Message Carbons (xep-0280)
- Message Delivery Receipts (xep-0184)
- MUC Mediated Invitation support
- Configurable time formatting
- Option to show JIDs in roster
- Option to hide empty groups in roster
- Generate UUID for unnamed new MUC rooms
- Themable UI preference to indicate OTR and PGP messages
- Reformatted help
- devel: Added functional tests using libexpect and libstabber

0.4.6
=====

- 16 colour support (/theme colours)
- UI preferences included in themes
- /wrap - Word wrapping
- /time - Show/hide time in main window, and configure precision
- /roster - Show/hide and customise roster panel
- /roster and /occupants panel size settings (% of screen width)
- /account default - Set default account for /connect
- /account remove
- /presence - Show/hide contact presence in titlebar 
- /resource - Override resource during chat, resource display settings
- Improved chat session handling <http://xmpp.org/rfcs/rfc6121.html#message-chat>
- Lower CPU usage with dynamic input blocking timeout
- Keychain/keyring integration using account eval_password property
- Disable term window title by default
- Fixed remote code execution bug on OSX when desktop notifications configured to show message text