1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
|
#! @im_path_perl@
################################################################
###
### imcd
###
### Copyright (C) 1997 Internet Message Group
###
### This Perl5 library conforms
### GNU GENERAL PUBLIC LICENSE Version 2.
###
###
### Author: Internet Message Group <img@mew.org>
### Created: Apr 23, 1997
### Revised: @im_revised@
###
my $VERSION = "imcd @im_version@";
$Prog = 'imcd';
##
## Require packages
##
use IM::Config;
use IM::Folder;
use IM::Util;
use integer;
use strict;
use vars qw($Prog $EXPLANATION @OptConfig
$opt_src $opt_quiet $opt_verbose $opt_debug $opt_help);
##
## Environments
##
$EXPLANATION = "
$Prog :: Internet Message Change Default Folder
$VERSION
Usage: $Prog [options]
";
@OptConfig = (
'src;F;;' => "Set source folder.",
'quiet;b;;' => "Do not bark.",
'verbose;b;;' => 'With verbose messages.',
'debug;d;;' => "With debug message.",
'help;b;;' => "Show this message.",
);
##
## Profile and option processing
##
init_opt(\@OptConfig);
read_cfg();
read_opt(\@ARGV); # help?
help($EXPLANATION) && exit $EXIT_SUCCESS if $opt_help;
debug_option($opt_debug) if $opt_debug;
##
## Main
##
my $folder = &cur_folder();
$folder = $opt_src if (defined $opt_src);
if (! -d &expand_path($folder)) {
im_die("no such folder $folder\n");
}
&set_cur_folder($folder);
print "$folder\n" unless $opt_quiet;
exit $EXIT_SUCCESS;
### Local Variables:
### mode: perl
### End:
|