Browse Source

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 years ago
parent
commit
56efdffc37
1 changed files with 6 additions and 1 deletions
  1. 6
    1
      bin/se

+ 6
- 1
bin/se View File

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