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

Last change on this file was 3650, checked in by Bruno Cornec, 7 years ago
  • Fix versions given back for mr-* tools
  • Log pb and mr versions in mindi log
  • mr-getparam now prints a version
  • Property svn:executable set to *
File size: 2.0 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::Version;
13use MondoRescue::Base;
14use Data::Dumper;
15use Getopt::Long qw(:config auto_abbrev no_ignore_case);
16use English;
17
18
19=pod
20
21=head1 NAME
22
23mr-getparam get MondoRescue parameter
24
25=head1 DESCRIPTION
26
27mr-getparam get a MondoRescue parameter from configuration files
28
29=head1 SYNOPSIS
30
31mr-getparam [-v][-h] param
32
33=head1 ARGUMENTS
34
35=over 4
36
37=item B<param>
38
39This is the parameter whose value should be returned
40
41=back
42
43=head1 OPTIONS
44
45=over 4
46
47=item B<-v|--verbose>
48
49Increase verbosity
50
51=item B<-h|--help>
52
53Print a brief help message and exits.
54
55=item B<--man>
56
57Prints the manual page and exits.
58
59=back
60
61=head1 WEB SITES
62
63The 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/>.
64
65=head1 USER MAILING LIST
66
67For community exchanges around MondoRescue please use the list L<http://sourceforge.net/mailarchive/forum.php?forum_name=mondo-devel>
68
69=head1 AUTHORS
70
71The MondoRescue team lead by Bruno Cornec L<mailto:bruno@mondorescue.org>.
72
73=head1 COPYRIGHT
74
75MondoRescue is distributed under the GPL v2.0 license or later,
76described in the file C<COPYING> included with the distribution.
77
78=cut
79
80# Global variables
81my ($mrver,$mrrev) = mr_version_init();
82my $appname = "mr-getparam";
83my %opts; # CLI Options
84
85# Initialize the syntax string
86
87pb_syntax_init("$appname Version $mrver-$mrrev\n");
88
89GetOptions("help|?|h" => \$opts{'h'},
90 "man" => \$opts{'man'},
91 "version" => \$opts{'version'},
92 "verbose|v+" => \$opts{'v'},
93) || pb_syntax(-1,0);
94
95if (defined $opts{'h'}) {
96 pb_syntax(0,1);
97}
98if (defined $opts{'version'}) {
99 pb_syntax(0,0);
100}
101if (defined $opts{'man'}) {
102 pb_syntax(0,2);
103}
104if (defined $opts{'v'}) {
105 $pbdebug++;
106}
107pb_log_init($pbdebug, $pbLOG);
108pb_temp_init($pbdebug);
109
110mr_init();
111mr_conf_get(@ARGV);
Note: See TracBrowser for help on using the repository browser.