Script 'schedule': add help output and version information.

This commit is contained in:
vonavi 2014-04-20 14:13:14 +04:00
parent 7fa83a471a
commit 1ebe482460

View File

@ -5,9 +5,46 @@
REPO=fat0troll/lorchess REPO=fat0troll/lorchess
TOURNAMENT=2014/1-tabiyas TOURNAMENT=2014/1-tabiyas
# Version information
VERSION="0.1"
# *FIXME* Withdrew players should be taken from the main config # *FIXME* Withdrew players should be taken from the main config
WITHDREW_PLS="trex6" WITHDREW_PLS="trex6"
argv0=${0##*/}
usage() {
cat <<EOF
List games on tours of tournament
Usage: $argv0 [options] [tours]
Tournament tours are restricted to sequence \`tours' given in
Bash-style syntax, i.e., \`tours' may include explicit numbers
(tours=1 3), intervals (tours={1..5}), or any combination of them.
If no tours are specified, display each tour until an empty
\`tour_info' is found. By default, only unaccomplished games are
listed.
Inner variable REPO points to the root of repository; REPO is a URL
link, absolute or relative path. Inner variable TOURNAMENT specifies
the sub-directory of tournament.
Options:
-a List accomplished games too
-p PLAYER Only PLAYER's games are listed; this supports globs
inside PLAYER for player matching
-f FORMAT Specify the output format; FORMAT is \`term'
(default), \`html', or \`lor'
-l Add the URL link to game (if accomplished)
-h Show this help output
-v Show version information
EOF
}
version() {
echo "${argv0}-${VERSION}"
}
# Variables # Variables
date_re="([0-9?]{2})\\.([0-9?]{2})\\.([0-9?]{4})" date_re="([0-9?]{2})\\.([0-9?]{2})\\.([0-9?]{4})"
res_re="(0|1|0\\.5):(0|1|0\\.5)" res_re="(0|1|0\\.5):(0|1|0\\.5)"