diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2008-03-08 11:32:39 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2008-03-08 11:32:39 +0000 |
commit | 39915c807d89e0016973994ee07c543fa15496ad (patch) | |
tree | 3c3e98c92ccf77d945d0e8a74d8c7c1330f5b271 /usr.sbin/pkg_add/pod | |
parent | b8e2eecbdbf6375f48b8206ca5681148781b49c6 (diff) |
let GetOpt count how many times it sees an option, removes special case
for -v, and allow other fun possibilities.
Diffstat (limited to 'usr.sbin/pkg_add/pod')
-rw-r--r-- | usr.sbin/pkg_add/pod/OpenBSD::Getopt.pod | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.sbin/pkg_add/pod/OpenBSD::Getopt.pod b/usr.sbin/pkg_add/pod/OpenBSD::Getopt.pod index a0d117b4626..26c6cefe63b 100644 --- a/usr.sbin/pkg_add/pod/OpenBSD::Getopt.pod +++ b/usr.sbin/pkg_add/pod/OpenBSD::Getopt.pod @@ -1,4 +1,4 @@ -$OpenBSD: OpenBSD::Getopt.pod,v 1.1 2005/08/17 08:32:29 espie Exp $ +$OpenBSD: OpenBSD::Getopt.pod,v 1.2 2008/03/08 11:32:38 espie Exp $ =head1 NAME @@ -23,6 +23,9 @@ all the options using the C<$optstring> as a list of simple switches Option values are directly written into local variables of the form C<$opt_S>, where C<S> is the switch name. +Contrary to L<getopt(3)>, C<$opt_S> is incremented each time the switch is +seen, to allow for stuff like C<-vv>. + An optional hash can be used as a second argument, with switches as keys and subs as values. When a switch is met, the sub C<$foo> is called as C<$foo> for a simple switch and as C<$foo(option_value)> for a switch |