-while {[regexp {^\-} [set arg [lindex $argv $ai]]]} {
- incr ai
- switch -exact -- $arg {
- -- { break }
- --pirate { set pirate [string totitle [nextarg]] }
- --ocean { set ocean [string totitle [nextarg]] }
- --clipboard-file { set clipboard_file [nextarg] }
- --notes { set notes_loc [nextarg] }
- default { badusage "unknown option $arg" }
+proc glset {n val} {
+ upvar #0 $n var
+ set var $val
+}
+
+set notes_loc vessel-notes
+set scraper {./yppedia-ocean-scraper --chart}
+
+proc parseargs {} {
+ global ai argv
+ global debug scraper
+ set ai 0
+
+ while {[regexp {^\-} [set arg [lindex $argv $ai]]]} {
+ incr ai
+ switch -exact -- $arg {
+ -- { break }
+ --pirate { glset pirate [string totitle [nextarg]] }
+ --ocean { glset ocean [string totitle [nextarg]] }
+ --clipboard-file { load-clipboard-file [nextarg] }
+ --local-html-dir { lappend scraper --local-html-dir=[nextarg] }
+ --notes { glset notes_loc [nextarg] }
+ --debug { incr debug }
+ default { badusage "unknown option $arg" }
+ }