+sub usage (\*) {
+ my ($fh) = @_;
+ print $fh "usage: $PROG [-u CONFIG] COMMAND\n";
+}
+
+sub help () {
+ usage *STDOUT;
+ print <<EOF;
+
+Command-line options:
+ -h, --help Show this help text
+ -u, --user-config Set user configuration file
+
+Commands:
+ volume-up
+ volume-down
+ scratch
+ enable/disable
+ play/pause
+ watch
+ now-playing
+ notify-now-playing
+ next-config
+EOF
+}
+
+my $bad = 0;
+GetOptions
+ "h|help" => sub { help; exit 0; },
+ "u|user-config=s" => \$C{config}
+ or $bad = 1;
+@ARGV == 1 or $bad = 1;
+if ($bad) { usage *STDERR; exit 2; }