From f02ff07b3de767a0c1d118a664b14313b8c889ac Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Tue, 1 Sep 2009 18:10:18 +0100 Subject: [PATCH] Usage information --- yarrg/update-master-info | 64 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 60 insertions(+), 4 deletions(-) diff --git a/yarrg/update-master-info b/yarrg/update-master-info index 3515bff..ba778d4 100755 --- a/yarrg/update-master-info +++ b/yarrg/update-master-info @@ -1,4 +1,53 @@ #!/usr/bin/perl -w +# +# MAIN ADMINISTRATIVE DATABASE UPDATE TOOL +# +# Usage: +# ./update-master-info [-d RSYNCDESTDIR] [-O OCEAN ... | -a] +# +# Usual usages: +# +# After editing source-info.txt to add commodities, or +# changing db-idempotent-update (eg to change the schema): +# ./update-master-info -d ~ftp/users/ijackson/yarrg/ +# This will update everything except the ocean topologies. +# +# To take account of new islands, or to fix a mistake in +# assigning island(s) to archipelago(es), or to add support +# for a new ocean: +# ./update-master-info -d ~ftp/users/ijackson/yarrg/ -O Midnight +# +# After a fix to a mistake on a YPPedia chart page, correcting +# only inter-island-distances: +# ./update-master-info -O Midnight +# +# After changing the algorithms for topology determination +# or YPPedia scraping: +# ./update-master-info -a +# and check that nothing unexpected changes. +# + +# This is part of ypp-sc-tools, a set of third-party tools for assisting +# players of Yohoho Puzzle Pirates. +# +# Copyright (C) 2009 Ian Jackson +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +# Yohoho and Puzzle Pirates are probably trademarks of Three Rings and +# are used without permission. This program is not endorsed or +# sponsored by Three Rings. use strict (qw(vars)); use DBI; @@ -79,10 +128,17 @@ while (@ARGV && $ARGV[0] =~ m/^-/) { $_= shift @ARGV; last if m/^--?$/; while (m/^-./) { - if (s/^-d//) { $rsyncdir= optarg(); } - elsif (s/^-O//) { push @specoceans, optarg(); } - elsif (s/^-a//) { $alloceans=1; } - else { die "$_ ?"; } + if (s/^-d//) { + die if defined $rsyncdir; + $rsyncdir= optarg(); + } elsif (s/^-O//) { + push @specoceans, optarg(); + } elsif (s/^-a//) { + die if $alloceans; + $alloceans=1; + } else { + die "$_ ?"; + } } } die if @ARGV; -- 2.30.2