starting to add wallpaper

This commit is contained in:
Paul Wilde 2023-12-12 21:29:22 +00:00
parent f77e0edd6c
commit 423831a401
4 changed files with 39 additions and 1 deletions

View file

@ -16,6 +16,7 @@ import util/screenshurrt
import util/calculaturr import util/calculaturr
import util/brightnurrs import util/brightnurrs
import util/tideurrl import util/tideurrl
import util/wallpapurr
proc dispatch*(cfg: Config) = proc dispatch*(cfg: Config) =
case cfg.run case cfg.run
@ -51,5 +52,7 @@ proc dispatch*(cfg: Config) =
brightnurrs.go() brightnurrs.go()
of Tideurrl: of Tideurrl:
tideurrl.go() tideurrl.go()
of Wallpapurr:
wallpapurr.go()
else: else:
echo "No valid run command given" echo "No valid run command given"

View file

@ -17,4 +17,5 @@ type
Screenshurrt, Screenshurrt,
Calculaturr, Calculaturr,
Brightnurrs, Brightnurrs,
Tideurrl Tideurrl,
Wallpapurr

View file

@ -53,6 +53,8 @@ proc parseArgs*() =
myConfig.run = Brightnurrs myConfig.run = Brightnurrs
of "tideurrl", "tides": of "tideurrl", "tides":
myConfig.run = Tideurrl myConfig.run = Tideurrl
of "wallpapurr", "wallpaper":
myConfig.run = Wallpapurr
else: else:
echo p.help echo p.help
quit(1) quit(1)
@ -180,3 +182,23 @@ proc parseTideurrlArgs*(): TideList =
stderr.writeLine getCurrentExceptionMsg() stderr.writeLine getCurrentExceptionMsg()
quit(1) quit(1)
return t return t
proc parseWallpapurrArgs*(): string =
var query = "devon coast"
let params = commandLineParams()
var p = newParser:
help("Args for wallpapurr")
arg("wallpapurr",help="can only ever be 'wallpapurr' as you won't have gotten this far otherwise")
option("-q","--query",help="query name")
try:
var opts = p.parse(params)
if opts.query != "":
query = opts.query
except ShortCircuit as err:
if err.flag == "argparse_help":
echo err.help
quit(1)
except UsageError:
stderr.writeLine getCurrentExceptionMsg()
quit(1)
return query

12
src/util/wallpapurr.nim Normal file
View file

@ -0,0 +1,12 @@
import ../common
import ../parser
import ../output
proc getDesign(): Info =
var data = newInfo("Wallpapurr")
return data
proc go*() =
var mytides = parseWallpapurrArgs()
echo mytides