我尝试为以下终端命令编写用法脚本:
sub usage {
if (@_) {
my ($msg) = @_;
chomp($msg);
print(STDERR "$msg\n");
}
my $prog = basename($0);
print(STDERR "$prog --help for usage\n");
exit(1);
}
run file in terminal:
./a.pl -prjroot="/home/welcome/all_data" -outdir="/home/output/all_data" mapfile="/home/welcome/text.txt"