Changeset 4402:20c50151d731 in livinglogic.python.xist

Show
Ignore:
Timestamp:
03/04/11 17:37:41 (9 years ago)
Author:
Walter Doerwald <walter@…>
Branch:
default
Message:

Add -a/--all option to uls, ucp and ucat.

Files:
4 modified

Legend:

Unmodified
Added
Removed
  • NEWS.rst

    r4395 r4402  
    1414*   The scripts ``uls``, ``ucp`` and ``ucat`` have new options :option:`--include` 
    1515    and :option:`--exclude` for including/excluding URLs that match a regular 
    16     expression. 
     16    expression. They also have an new option :option:`--all` to include/exclude 
     17    dot files (i.e. files whose name starts with a dot) 
    1718 
    1819*   The unused :option:`--verbose` was removed from the script ``ucat``. 
  • src/ll/scripts/ucat.py

    r4382 r4402  
    3232        if args.exclude is not None and args.exclude.search(strurl) is not None: 
    3333            return False 
     34        if not args.all and strurl.startswith("."): 
     35            return False 
    3436        return True 
    3537 
     
    6365    p.add_argument("-i", "--include", dest="include", metavar="PATTERN", help="Include only URLs matching PATTERN (default: %(default)s)", type=re.compile) 
    6466    p.add_argument("-e", "--exclude", dest="exclude", metavar="PATTERN", help="Exclude URLs matching PATTERN (default: %(default)s)", type=re.compile) 
     67    p.add_argument("-a", "--all", dest="all", help="Include dot files? (default: %(default)s)", action=misc.FlagAction, default=False) 
    6568 
    6669    args = p.parse_args(args) 
  • src/ll/scripts/ucp.py

    r4390 r4402  
    3131            return False 
    3232        if args.exclude is not None and args.exclude.search(strurl) is not None: 
     33            return False 
     34        if not args.all and strurl.startswith("."): 
    3335            return False 
    3436        return True 
     
    9395    p.add_argument("-i", "--include", dest="include", metavar="PATTERN", help="Include only URLs matching PATTERN (default: %(default)s)", type=re.compile) 
    9496    p.add_argument("-e", "--exclude", dest="exclude", metavar="PATTERN", help="Exclude URLs matching PATTERN (default: %(default)s)", type=re.compile) 
     97    p.add_argument("-a", "--all", dest="all", help="Include dot files? (default: %(default)s)", action=misc.FlagAction, default=False) 
    9598 
    9699    args = p.parse_args(args) 
  • src/ll/scripts/uls.py

    r4401 r4402  
    4545 
    4646    ``-w``, ``--spacing`` : integer 
    47         The number of spaces between column (only relevant when neither ``--long`` 
     47        The number of spaces between columns (only relevant when neither ``--long`` 
    4848        nor ``--one`` is specified) 
    4949 
     
    5353    ``-e``, ``--expression`` : regular expression 
    5454        URLs matching the regular expression will be not be output. 
     55 
     56    ``-a``, ``--all`` :  ``false``, ``no``, ``0``, ``true``, ``yes`` or ``1`` 
     57        Output files whose name starts with a dot? 
    5558""" 
    5659 
     
    120123            return False 
    121124        if args.exclude is not None and args.exclude.search(strurl) is not None: 
     125            return False 
     126        if not args.all and strurl.startswith("."): 
    122127            return False 
    123128        return True 
     
    222227    p.add_argument("-i", "--include", dest="include", metavar="PATTERN", help="Include only URLs matching PATTERN (default: %(default)s)", type=re.compile) 
    223228    p.add_argument("-e", "--exclude", dest="exclude", metavar="PATTERN", help="Exclude URLs matching PATTERN (default: %(default)s)", type=re.compile) 
     229    p.add_argument("-a", "--all", dest="all", help="Include dot files? (default: %(default)s)", action=misc.FlagAction, default=False) 
    224230 
    225231    args = p.parse_args(args)