← Previous
→ Next
Contents
Using the command line interface
The command line interface, tide, supports a number of modes that cannot be accessed with the
interactive client. It can run without X-windows, and unlike the
interactive client, it can easily be invoked from shell scripts.
The minimal usage is simply to specify a location with -l. The
default mode is plain, and the default format is text:
$ tide -l "anchorage, al"
Anchorage, Alaska
61.2383° N, 149.8883° W
2003-02-12 7:27 AM AKST Moonset
2003-02-12 8:50 AM AKST Sunrise
2003-02-12 10:19 AM AKST 10.72 feet Low Tide
2003-02-12 11:34 AM AKST Moonrise
2003-02-12 3:42 PM AKST 24.41 feet High Tide
2003-02-12 5:37 PM AKST Sunset
2003-02-12 11:00 PM AKST 1.95 feet Low Tide
2003-02-13 5:31 AM AKST 25.51 feet High Tide
2003-02-13 8:29 AM AKST Moonset
If you use the same location a lot, you can set the environment
variable XTIDE_DEFAULT_LOCATION to its name instead of using -l
every time.
The non-interactive client supports most of the command line switches
related to settings which are described in a
later section. (As a notable exception, the graph font cannot be
changed.) In addition, it supports the following.
-
-b "YYYY-MM-DD HH:MM"
-
Specify the begin (start) time for predictions using the ISO 8601
compliant format YYYY-MM-DD HH:MM, where hours
range from 00 to 23. The timestamp is in the local time
zone for the location, or in UTC if the -z setting is engaged.
If clock mode is selected or if no -b is supplied, the current time will be used.
(Note Quirk #1)
-
-e "YYYY-MM-DD HH:MM"
-
Specify the end (stop) time for predictions in banner, calendar, alt. calendar,
medium rare, plain, raw, or stats mode. Does not apply in graph and clock
modes: the effective end time for graph and clock modes is entirely
determined by the start time (-b), the width (-cw, -gw or -tw), and the aspect
(-ga). The format and time zone are the same as for -b.
If no -e is supplied, the end time will be set to four days after the
begin time. (Note Quirk #2)
When it matters, -b and -e ranges mean specifically "all t such
that b ≤ t < e."
-
-f c|h|i|l|p|t|v
-
Specify the output format as CSV, HTML, iCalendar, LaTeX, PNG, text, or SVG. See the
modes page for
legal modes and formats. The default is text.
-
-l "Location Name"
-
Specify a location for tide predictions. You get the first
station where the name supplied with -l is a case-insensitive
match with the beginning (or the entirety) of the station's name.
You can use the -l switch more than once if you want to specify
multiple locations.
-
-m a|b|c|C|g|k|l|m|p|r|s
-
Specify mode to be about, banner, calendar, alt. calendar, graph, clock, list, medium rare, plain, raw, or
stats. See the
modes page for
legal modes and formats. The default is plain.
-
-ml [-]N.NN(ft|m|kt)
-
Specify the mark level to be used in predictions. The
predictions will include the times when the tide level crosses
the mark. Not supported in clock mode.
Example usage: -ml -0.25ft
-
-o "filename"
-
Redirect output to the specified file (appends).
-
-s "HH:MM"
-
Specify the step interval, in hours and minutes, for raw
or medium rare mode predictions. The default is one hour.
-
-v
-
Print version string and exit. Please note that versions marked as
DEVELOPMENT versions are not really versioned; they are work in
progress and will change without warning.
The interactive interface does not support all of these switches
and options. Refer to the previous page for a list of the options
supported by the interactive interface.
XTide understands the following syntactic shortcuts:
- Arguments can be concatenated with their switches.
- A yes/no switch that omits its argument implies "y".
- Using +xx instead of -xx for a yes/no switch inverts the argument (so if the argument is omitted, "n" is implied).
Some shorthand forms are ambiguous. For example, -lw5 could mean
"set the line width to 5" (-lw 5) or it could mean "load the location
named w5" (-l w5). If this happens, you will get an error and will
need to spell out what you meant.
← Previous
→ Next
Contents