Subversion Repositories camp_sysinfo_client_3

Rev

Rev 223 | Rev 228 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 223 Rev 227
Line 16... Line 16...
16
#
16
#
17
# v1.3.1 20191112 RWR
17
# v1.3.1 20191112 RWR
18
# Fixed showEntry() to set value to empty string if it is null 
18
# Fixed showEntry() to set value to empty string if it is null 
19
 
19
 
20
use Getopt::Long;
20
use Getopt::Long;
21
 
-
 
-
 
21
use Data::Dumper;
22
 
22
 
23
our $VERSION = '1.3.1';
23
our $VERSION = '1.3.1';
24
 
24
 
25
# find our location and use it for searching for libraries
25
# find our location and use it for searching for libraries
26
BEGIN {
26
BEGIN {
Line 232... Line 232...
232
   print "All parameters accept the short flag, ie -v, -f, -o and -h\n";
232
   print "All parameters accept the short flag, ie -v, -f, -o and -h\n";
233
   exit;
233
   exit;
234
}
234
}
235
 
235
 
236
 
236
 
237
my @confFileName;
237
my $confFileName;
238
my $outputFile;
238
my $outputFile;
239
my $verbose;
239
my $verbose;
240
my $help;
240
my $help;
241
my $version;
241
my $version;
242
my $test = 0;
242
my $test = 0;
Line 248... Line 248...
248
# there can be multiple files passed, and an entry can have a comma
248
# there can be multiple files passed, and an entry can have a comma
249
# separated list. The files will be processed in order, with the last
249
# separated list. The files will be processed in order, with the last
250
# one passed in being the one that overrides everything.
250
# one passed in being the one that overrides everything.
251
GetOptions (
251
GetOptions (
252
            "verbose|v+"  => \$verbose, # verbosity level, 0-9
252
            "verbose|v+"  => \$verbose, # verbosity level, 0-9
253
            'file|f=s'    => \@confFileName, # array of files to read
253
            'file|f=s'    => \$confFileName, # file name to use
254
            'output|o=s'  => \$outputFile, # file to save to
254
            'output|o=s'  => \$outputFile, # file to save to
255
            'test|t'      => \$test, # test the config file
255
            'test|t'      => \$test, # test the config file
256
            'dryrun|n'    => \$dryRun, # do not save result
256
            'dryrun|n'    => \$dryRun, # do not save result
257
            'quiet|q'     => \$quiet, # do not ask any questions
257
            'quiet|q'     => \$quiet, # do not ask any questions
258
            'help|h'      => \$help
258
            'help|h'      => \$help
259
            ) or die "Error parsing command line\n";
259
            ) or die "Error parsing command line\n";
260
                  
260
                  
261
if ( $help ) { &help() ; exit; }
261
if ( $help ) { &help() ; exit; }
262
 
262
 
263
# if they passed something like -f file1,file2,file3, parse it out
-
 
264
@confFileName = split(/,/,join(',',@confFileName));
-
 
265
 
-
 
266
# look for the standard configuration file in the standard place
263
# look for the standard configuration file in the standard place
-
 
264
unless ( $confFileName ) {
267
( $confDir, $sysinfo3 ) = &findConf( $sysinfo3 );
265
   ( $confDir, $sysinfo3 ) = &findConf( $sysinfo3 );
268
$outputFile = $confDir . '/' . $sysinfo3 unless $outputFile;
266
   $outputFile = $confDir . '/' . $sysinfo3 unless $outputFile;
269
push @confFileName, $confDir . "/" . $sysinfo3 if ( $confDir );
267
   $confFileName =  $confDir . "/" . $sysinfo3 if ( $confDir );
270
 
268
}
271
print "Loading defaults from existing configs\n";
269
print "Loading defaults from existing configs\n";
272
$config = &makeConfig( $outputFile, @confFileName  );
270
$config = &makeConfig( $outputFile, $confFileName  );
-
 
271
 
-
 
272
die Dumper($config) . "\n";
273
 
273
 
274
my $selection;
274
my $selection;
275
while ( ! $quiet && ( $selection = &displayEditScreen( $config ) ) ne 'd' ) {
275
while ( ! $quiet && ( $selection = &displayEditScreen( $config ) ) ne 'd' ) {
276
   &editSelection( $selection );
276
   &editSelection( $selection );
277
}
277
}