/* * Copyright (c) 2009 Zmanda, Inc. All Rights Reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published * by the Free Software Foundation. * * 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, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300 * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com */ %perlcode %{ =head1 NAME Amanda::Cmdline - utilities for handling command lines =head1 SYNOPSIS use Amanda::Cmdline; my $spec = Amanda::Cmdline::dumpspec_t->new($host, $disk, $datestamp, $level); print "host: $spec->{'host'}; disk: $spec->{'disk'}\n"; my @specs = Amanda::Cmdline::parse_dumpspecs(["host", "disk", "date"], $Amanda::Cmdline::CMDLINE_PARSE_DATESTAMP); =head1 Amanda::Cmdline::dumpspec_t Objects =head2 Instance Variables =over =item C<$host> =item C<$disk> =item C<$datestamp> =item C<$level> =back =head2 Methods =over =item C Format the dumpspec as a string. =back =head1 Functions =over =item C This function returns a string representing the formatted form of the given dumpspec. This formatting is the same as performed by C, but does not need a C. =item C This function parses C<@cmdline> into a list of C objects, according to C<$flags>, which is a logical combination of zero or more of C<$CMDLINE_PARSE_DATESTAMP> to recognize datestamps and C<$CMDLINE_PARSE_LEVEL> to recognize levels. =item C This function compares a header to a list of dumpspecs, returning true if the header matches at least one dumpspec. If C<@dumpspecs> is empty, the function returns false. =back =head1 SEE ALSO L handles C<-o> options itself, through C. =cut %}