Changeset 2919 for trunk/tools


Ignore:
Timestamp:
Feb 27, 2000, 1:40:21 AM (26 years ago)
Author:
bird
Message:

Added -r option for reverse directory processing order.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/bin/DoWithDirs.cmd

    r2758 r2919  
    1 /* $Id: DoWithDirs.cmd,v 1.2 2000-02-11 15:04:26 bird Exp $
     1/* $Id: DoWithDirs.cmd,v 1.3 2000-02-27 00:40:21 bird Exp $
    22 *
    33 * Syntax: dowithdirs.cmd [-e<list of excludes>] [-cp] [-i] <cmd with args...>
     
    77 *            Default action is to pass the directory name as last argument.
    88 *    -i      Ignore command failure (rc=0)
    9  *
     9 *    -r      Process diretories in reverse order.
    1010 */
    1111
     
    1717    asIgnore.0 = 0;
    1818    fCD = 0;
     19    fReverse = 0;
    1920
    2021    /* parse arguments */
     
    6263                    end
    6364
     65                    when ch = 'R' then
     66                    do
     67                        fReverse = 1;
     68                    end
     69
    6470                    otherwise
    6571                        say 'unknown argument:' sArg.i;
     
    9298
    9399    sArgDirs = ' ';
    94     do i = 1 to asDirs.0
     100    do ii = 1 to asDirs.0
     101        /* calculate index */
     102        if (fReverse) then
     103            i = asDirs.0 - ii + 1;
     104        else
     105            i = ii;
     106
    95107        /* ignore the directory? */
    96108        fFound = 0;
     
    137149    say '           Default action is to pass the directory name as last argument.';
    138150    say '   -i      Ignore command failure (rc=0)';
     151    say '   -r      Process diretories in reverse order.';
Note: See TracChangeset for help on using the changeset viewer.