source: branches/3.3/MondoRescue/bin/mr-getparam @ 3644

Last change on this file since 3644 was 3644, checked in by Bruno Cornec, 4 years ago
  • Adds a new perl script (mr-getparam) to get parameters from mondorescue conf file (WIP)
  • Adds a new perl script (mr-distro-getparam) to get parameters from mondorescue conf file based on the current distribution
  • Property svn:executable set to *
File size: 1.9 KB
Line 
1#!/usr/bin/perl -w
2#
3# $Id$
4# Copyright B. Cornec 2005-today
5# Provided under the GPL v2
6#
7# Get the value of the parameter passed in argument
8#
9use strict 'vars';
10use ProjectBuilder::Base;
11use ProjectBuilder::Version;
12use MondoRescue::Base;
13use Data::Dumper;
14use Getopt::Long qw(:config auto_abbrev no_ignore_case);
15use English;
16
17
18=pod
19
20=head1 NAME
21
22mr-getparam get MondoRescue parameter
23
24=head1 DESCRIPTION
25
26mr-getparam get a MondoRescue parameter from configuration files
27
28=head1 SYNOPSIS
29
30mr-getparam [-v][-h] param
31
32=head1 ARGUMENTS
33
34=over 4
35
36=item B<param>
37
38This is the parameter whose value should be returned
39
40=back
41
42=head1 OPTIONS
43
44=over 4
45
46=item B<-v|--verbose>
47
48Increase verbosity
49
50=item B<-h|--help>
51
52Print a brief help message and exits.
53
54=item B<--man>
55
56Prints the manual page and exits.
57
58=back
59
60=head1 WEB SITES
61
62The main Web site of the project is available at L<http://www.mondorescue.org>. Bug reports should be filled using the trac instance of the project at L<http://trac.mondorescue.org/>.
63
64=head1 USER MAILING LIST
65
66For community exchanges around MondoRescue please use the list L<http://sourceforge.net/mailarchive/forum.php?forum_name=mondo-devel>
67
68=head1 AUTHORS
69
70The MondoRescue team lead by Bruno Cornec L<mailto:bruno@mondorescue.org>.
71
72=head1 COPYRIGHT
73
74MondoRescue is distributed under the GPL v2.0 license or later,
75described in the file C<COPYING> included with the distribution.
76
77=cut
78
79# Global variables
80my ($mrver,$mrrev) = pb_version_init();
81my $appname = "mr-getparam";
82my %opts;                   # CLI Options
83
84# Initialize the syntax string
85
86pb_syntax_init("$appname Version $mrver-$mrrev\n");
87
88GetOptions("help|?|h" => \$opts{'h'}, 
89        "man" => \$opts{'man'},
90        "verbose|v+" => \$opts{'v'},
91) || pb_syntax(-1,0);
92
93if (defined $opts{'h'}) {
94    pb_syntax(0,1);
95}
96if (defined $opts{'man'}) {
97    pb_syntax(0,2);
98}
99if (defined $opts{'v'}) {
100    $pbdebug++;
101}
102pb_log_init($pbdebug, $pbLOG);
103pb_temp_init($pbdebug);
104
105mr_init();
106mr_conf_get(@ARGV);
Note: See TracBrowser for help on using the repository browser.