ソースを参照

Implemented --long

Warning: now short for `--lines` is `-n`, not `-l`, which is taken by
`--long`.  The idea is to make it resemble `-l` in `-ls -l` (although
the real meaning for `ls` is somewhat different).
Alois Mahdal 11 年 前
コミット
56efdffc37
共有1 個のファイルを変更した6 個の追加1 個の削除を含む
  1. 6
    1
      bin/se

+ 6
- 1
bin/se ファイルの表示

14
 
14
 
15
 my $direction = 'encz.en';
15
 my $direction = 'encz.en';
16
 my $lines = 25;
16
 my $lines = 25;
17
+my $max_lines = 50;
18
+my $long = 0;
17
 my $man = 0;
19
 my $man = 0;
18
 my $help = 0;
20
 my $help = 0;
19
 my $host = 'www.slovnik.cz';
21
 my $host = 'www.slovnik.cz';
20
 
22
 
21
 GetOptions(
23
 GetOptions(
22
-    'lines|l=i'     => \$lines,
24
+    'long|l'     => \$long,
25
+    'lines|n=i'     => \$lines,
23
     'direction|d=s' => \$direction,
26
     'direction|d=s' => \$direction,
24
     'help|?|h'    => \$help,
27
     'help|?|h'    => \$help,
25
     'man'       => \$man
28
     'man'       => \$man
27
 pod2usage(1) if $help;
30
 pod2usage(1) if $help;
28
 pod2usage(-exitstatus => 0, -verbose => 2) if $man;
31
 pod2usage(-exitstatus => 0, -verbose => 2) if $man;
29
 
32
 
33
+$lines = $max_lines if $long;
34
+
30
 my $word = shift or usage;
35
 my $word = shift or usage;
31
 
36
 
32
 my $query  = sprintf(
37
 my $query  = sprintf(