Changeset 246900a for app/src/kot


Ignore:
Timestamp:
03/14/08 14:05:07 (16 years ago)
Author:
pawelk <pawelk@…>
Branches:
master, help
Children:
b2647de
Parents:
8d3e6ab
git-author:
pawelk <pawelk@…> (03/14/08 14:05:07)
git-committer:
pawelk <pawelk@…> (03/14/08 14:05:07)
Message:

Przejrzałem kody programów pod kątem korzystania z plików konfiguracyjnych.

git-svn-id: svn://atos.wmid.amu.edu.pl/utt@10 e293616e-ec6a-49c2-aa92-f4a8b91c5d16

File:
1 edited

Legend:

Unmodified
Added
Removed
  • app/src/kot/kot

    r25ae32e r246900a  
    88my $spaces=0; 
    99 
    10 my $configfile1="../../conf/kot.conf"; 
    11 my $configfile2="../conf/kot.conf"; 
     10my $systemconfigfile='/usr/local/etc/utt/kot.conf'; 
     11my $userconfigfile="$ENV{'HOME'}/.utt/kot.conf"; 
    1212 
    1313#read configuration files########################### 
    1414my $file; 
    15 foreach $file ($configfile1, $configfile2){ 
     15foreach $file ($systemconfigfile, $userconfigfile){ 
    1616  if(open(CONFIG, $file)){ 
    1717        while (<CONFIG>) { 
    18                 chomp;                   
    19                 s/#.*//;                 
    20                 s/^\s+//;                
    21                 s/\s+$//;                
    22                 next unless length;      
     18                chomp; 
     19                s/#.*//; 
     20                s/^\s+//; 
     21                s/\s+$//; 
     22                next unless length; 
    2323                my ($name, $value) = split(/\s*=\s*/, $_, 2); 
    2424                if(($name eq "gap-fill")or($name eq "g")){ 
     
    3131                        $help=1; 
    3232                } 
    33          
    34         }  
     33 
     34        } 
    3535        close CONFIG; 
    3636  } 
     
    4949Options: 
    5050   --gap-fill -g                  Help. 
    51    --spaces -r                     
     51   --spaces -r 
    5252   --define=FILE                  Read macrodefinitions from FILE. 
    5353   --flex-template=FILE           Read flex code template from FILE. 
     
    7171{ 
    7272    my ($start,$len,$type,$form) = /^\s*(\d+)\s+(\d+)\s+(\S+)\s+(\S+)/; 
    73      
     73 
    7474    if($start > $prevend) 
    7575    { 
     
    7878 
    7979    $prevend=$start+$len; 
    80      
     80 
    8181    next if $len==0;# || $form eq "*"; 
    8282 
     
    9494    print $form; 
    9595} 
    96  
    97 #print $gap_fill; 
    98  
    99 # print "\n"; 
Note: See TracChangeset for help on using the changeset viewer.