Imported Upstream version 3.1.0
[debian/amanda] / perl / Amanda / Cmdline.pod
1 /*
2  * Copyright (c) 2009 Zmanda, Inc.  All Rights Reserved.
3  *
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.
7  *
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
11  * for more details.
12  *
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
16  *
17  * Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300
18  * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
19  */
20
21 %perlcode %{
22
23 =head1 NAME
24
25 Amanda::Cmdline - utilities for handling command lines
26
27 =head1 SYNOPSIS
28
29   use Amanda::Cmdline;
30
31   my $spec = Amanda::Cmdline::dumpspec_t->new($host, $disk, $datestamp, $level);
32   print "host: $spec->{'host'}; disk: $spec->{'disk'}\n";
33
34   my @specs = Amanda::Cmdline::parse_dumpspecs(["host", "disk", "date"],
35                             $Amanda::Cmdline::CMDLINE_PARSE_DATESTAMP);
36
37 =head1 Amanda::Cmdline::dumpspec_t Objects
38
39 =head2 Instance Variables
40
41 =over
42
43 =item C<$host>
44
45 =item C<$disk>
46
47 =item C<$datestamp>
48
49 =item C<$level>
50
51 =back
52
53 =head2 Methods
54
55 =over
56
57 =item C<format()>
58
59 Format the dumpspec as a string.
60
61 =back
62
63 =head1 Functions
64
65 =over
66
67 =item C<format_dumpspec_components($host, $disk, $datestamp, $level)>
68
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>.
72
73 =item C<parse_dumpspecs([@cmdline], $flags)>
74
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.
79
80 =item C<header_matches_dumpspecs($hdr, [@dumpspecs])>
81
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
84 returns false.
85
86 =back
87
88 =head1 SEE ALSO
89
90 L<Amanda::Config> handles C<-o> options itself, through
91 C<config_overrides>.
92
93 =cut
94
95
96 %}