Welcome to mirror list, hosted at ThFree Co, Russian Federation.

beautify.perl « other « scripts - github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 8294dcc03a3eee6170dee707c9e201c8ae1c18b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/perl

opendir(DIR,".") or die "Can't open the current directory: $!\n";

# read file/directory names in that directory into @names 
@names = readdir(DIR) or die "Unable to read current dir:$!\n";

foreach $name (@names) {
   next if ($name eq ".");   # skip the current directory entry
   next if ($name eq "..");  # skip the parent  directory entry

   if (-d $name){            # is this a directory?
      `astyle --style="k&r" -s2 --recursive -v $name/*.h $name/*.cpp`;
      next;                  # can skip to the next name in the for loop 
   }
}

closedir(DIR);