Changeset 1450


Ignore:
Timestamp:
Apr 4, 2012, 5:14:50 PM (7 years ago)
Author:
ebaudrez
Message:

turned $nrfile into a command-line option as well

File:
1 edited

Legend:

Unmodified
Added
Removed
  • projects/md2mb/devel/md2mb/bin/md2mb.pl

    r1449 r1450  
    2626Aborting
    2727EOF
    28 # CHANGE AS YOU WISH
    29 # Is the newroot a file (1) or a dir (0)
    30 my $nrisfile = 0;
    31 # END CHANGE
    3228my $debug = 0;
     29my $file = 0; # is the newroot a file (1) or a dir (0) ?
    3330my $help = 0;
    3431my $man = 0;
     
    4441GetOptions(
    4542    'debug|d'         => \$debug,
     43    'file|f'          => \$file,
    4644    'help|h'          => \$help,
    4745    'man|m'           => \$man,
     
    7775# create destination path
    7876if ($debug) {
    79     print "TARGET DIR: mkdir -p $newroot\n" if ((not -d "$newroot") && (not $nrisfile));
    80     print "CMD: mkdir -p $newroot\n" if ((not -d "$newroot") && (not $nrisfile));
     77    print "TARGET DIR: mkdir -p $newroot\n" if ((not -d "$newroot") && (not $file));
     78    print "CMD: mkdir -p $newroot\n" if ((not -d "$newroot") && (not $file));
    8179} else {
    82     mkpath("$newroot",0, 0755) if ((not -d "$newroot") && (not $nrisfile));
     80    mkpath("$newroot",0, 0755) if ((not -d "$newroot") && (not $file));
    8381}
    8482
     
    181179 Options:
    182180   -debug   | -d        debug mode
     181   -file    | -f                whether $newroot is a file or a directory
    183182   -help    | -h        brief help message
    184183   -man     | -m        full documentation
     
    197196so this is safe to use when testing.
    198197
     198=item B<-file>
     199
     200Specifies that $newroot is a file. If this option is omitted, it is assumed
     201that $newroot is a directory instead.
     202
    199203=item B<-help>
    200204
Note: See TracChangeset for help on using the changeset viewer.