如何在perl中为以下终端输入和输出编写用法脚本?

时间:2017-03-30 12:45:29

标签: perl

我尝试为以下终端命令编写用法脚本:

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"

0 个答案:

没有答案