python-adfs

changeset 57:6a2474543cf7

Some getopt fixes related to the number of arguments required for the list operation. Reported by Ralph Corderoy.
author David Boddie <david@boddie.org.uk>
date Sun Jul 20 17:30:08 2003 +0200
parents eaa19e1bbe18
children 62b3240b117e
files ADF2INF.py
diffstat 1 files changed, 15 insertions(+), 13 deletions(-) [+]
line diff
     1.1 --- a/ADF2INF.py	Sun Jul 20 17:29:22 2003 +0200
     1.2 +++ b/ADF2INF.py	Sun Jul 20 17:30:08 2003 +0200
     1.3 @@ -45,7 +45,7 @@
     1.4      use_getopt = 1
     1.5  
     1.6  
     1.7 -__version__ = "0.34c (Sat 19th July 2003)"
     1.8 +__version__ = "0.35c (Sun 20th July 2003)"
     1.9  
    1.10  default_convert_dict = {"/": "."}
    1.11  
    1.12 @@ -102,28 +102,30 @@
    1.13      
    1.14          return None
    1.15      
    1.16 -    elif match.has_key("list") and len(args) != 1:
    1.17 +    elif match.has_key("list"):
    1.18      
    1.19 -        # For list operations, there should be one remaining argument.
    1.20 -        return None
    1.21 +        if len(args) != 1:
    1.22 +        
    1.23 +            # For list operations, there should be one remaining argument.
    1.24 +            return None
    1.25      
    1.26 -    elif match.has_key("verify") and len(args) != 1:
    1.27 +    elif match.has_key("verify"):
    1.28      
    1.29 -        # For verify operations, there should be one remaining argument.
    1.30 -        return None
    1.31 +        if len(args) != 1:
    1.32 +        
    1.33 +            # For verify operations, there should be one remaining argument.
    1.34 +            return None
    1.35      
    1.36      elif len(args) != 2:
    1.37      
    1.38          # For all other operations, there should be two remaining arguments.
    1.39          return None
    1.40      
    1.41 -    else:
    1.42 +    i = 0
    1.43 +    for arg in args:
    1.44      
    1.45 -        i = 0
    1.46 -        for arg in args:
    1.47 -        
    1.48 -            match[arg_list[i]] = arg
    1.49 -            i = i + 1
    1.50 +        match[arg_list[i]] = arg
    1.51 +        i = i + 1
    1.52      
    1.53      if match == {}: match = None
    1.54