2 * Copyright (c) 2009 Zmanda, Inc. All Rights Reserved.
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 2 as published
6 * by the Free Software Foundation.
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
10 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * You should have received a copy of the GNU General Public License along
14 * with this program; if not, write to the Free Software Foundation, Inc.,
15 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 * Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300
18 * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
25 Amanda::Cmdline - utilities for handling command lines
31 my $spec = Amanda::Cmdline::dumpspec_t->new($host, $disk, $datestamp, $level);
32 print "host: $spec->{'host'}; disk: $spec->{'disk'}\n";
34 my @specs = Amanda::Cmdline::parse_dumpspecs(["host", "disk", "date"],
35 $Amanda::Cmdline::CMDLINE_PARSE_DATESTAMP);
37 =head1 Amanda::Cmdline::dumpspec_t Objects
39 =head2 Instance Variables
59 Format the dumpspec as a string.
67 =item C<format_dumpspec_components($host, $disk, $datestamp, $level)>
69 This function returns a string representing the formatted form of the
70 given dumpspec. This formatting is the same as performed by
71 C<format_dumpspec_components>, but does not need a C<dumpspec_t>.
73 =item C<parse_dumpspecs([@cmdline], $flags)>
75 This function parses C<@cmdline> into a list of C<dumpspec_t> objects,
76 according to C<$flags>, which is a logical combination of zero or more
77 of C<$CMDLINE_PARSE_DATESTAMP> to recognize datestamps and
78 C<$CMDLINE_PARSE_LEVEL> to recognize levels.
80 =item C<header_matches_dumpspecs($hdr, [@dumpspecs])>
82 This function compares a header to a list of dumpspecs, returning true if the
83 header matches at least one dumpspec. If C<@dumpspecs> is empty, the function
90 L<Amanda::Config> handles C<-o> options itself, through