! See http://factorcode.org/license.txt for BSD license
USING: accessors arrays ascii assocs calendar calendar.format
-combinators continuations csv formatting fry grouping
-http.client io io.encodings.ascii io.files io.styles kernel math
-math.extras math.parser memoize regexp sequences sorting.human
-splitting strings urls wrap.strings ;
+combinators command-line continuations csv formatting fry
+grouping http.client io io.encodings.ascii io.files io.styles
+kernel math math.extras math.parser memoize namespaces regexp
+sequences sorting.human splitting strings urls wrap.strings ;
IN: metar
"V" split1 [ parse-compass ] bi@
", variable from %s to %s" sprintf ;
+! FIXME: "1 1/2SM" visibility doesn't work
: parse-visibility ( str -- str' )
dup first {
{ CHAR: M [ rest "less than " ] }
M: string taf.
[ taf <taf-report> taf-report. ]
[ drop "%s TAF not found\n" printf ] recover ;
+
+: metar-main ( -- )
+ command-line get [
+ [ metar print ] [ taf print ] bi nl
+ ] each ;
+
+MAIN: metar-main