aboutsummaryrefslogtreecommitdiffstats
path: root/src/argparser.py
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2013-06-17 22:06:36 +0200
committerMattias Andrée <maandree@operamail.com>2013-06-17 22:06:36 +0200
commita85246104dda362119dd288c51f43a976f42c60e (patch)
treebfb8b608208c0f05336c6982bb23109f2c563f54 /src/argparser.py
parentadd hasinterpretor parameter to parent_name (diff)
downloadargparser-a85246104dda362119dd288c51f43a976f42c60e.tar.gz
argparser-a85246104dda362119dd288c51f43a976f42c60e.tar.bz2
argparser-a85246104dda362119dd288c51f43a976f42c60e.tar.xz
variable rename
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r--src/argparser.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/argparser.py b/src/argparser.py
index f1a0e1b..e536f5d 100644
--- a/src/argparser.py
+++ b/src/argparser.py
@@ -62,7 +62,7 @@ class ArgParser():
self.__description = description
self.__usage = usage
self.__longdescription = longdescription
- self.__arguments = []
+ self.__options = []
self.opts = {}
self.optmap = {}
self.__out = sys.stderr.buffer if usestderr else sys.stdout.buffer
@@ -137,7 +137,7 @@ class ArgParser():
@parma default:str|int The default argument's name or index
@param help:str? Short description, use `None` to hide the option
'''
- self.__arguments.append((ArgParser.ARGUMENTLESS, alternatives, None, help))
+ self.__options.append((ArgParser.ARGUMENTLESS, alternatives, None, help))
stdalt = alternatives[default] if isinstance(default, int) else default
self.opts[stdalt] = None
for alt in alternatives:
@@ -153,7 +153,7 @@ class ArgParser():
@param arg:str The name of the takes argument, one word
@param help:str? Short description, use `None` to hide the option
'''
- self.__arguments.append((ArgParser.ARGUMENTED, alternatives, arg, help))
+ self.__options.append((ArgParser.ARGUMENTED, alternatives, arg, help))
stdalt = alternatives[default] if isinstance(default, int) else default
self.opts[stdalt] = None
for alt in alternatives:
@@ -169,7 +169,7 @@ class ArgParser():
@param arg:str The name of the takes arguments, one word
@param help:str? Short description, use `None` to hide the option
'''
- self.__arguments.append((ArgParser.VARIADIC, alternatives, arg, help))
+ self.__options.append((ArgParser.VARIADIC, alternatives, arg, help))
stdalt = alternatives[default] if isinstance(default, int) else default
self.opts[stdalt] = None
for alt in alternatives:
@@ -284,7 +284,7 @@ class ArgParser():
if len(argqueue) >= i:
self.opts[opt].append(arg)
- for arg in self.__arguments:
+ for arg in self.__options:
if arg[0] == ArgParser.VARIADIC:
varopt = self.opts[arg[1][0]]
if varopt is not None:
@@ -396,7 +396,7 @@ class ArgParser():
self.print()
maxfirstlen = []
- for opt in self.__arguments:
+ for opt in self.__options:
opt_alts = opt[1]
opt_help = opt[3]
if opt_help is None:
@@ -409,7 +409,7 @@ class ArgParser():
self.print('\033[01mSYNOPSIS:\033[21m')
(lines, lens) = ([], [])
- for opt in self.__arguments:
+ for opt in self.__options:
opt_type = opt[0]
opt_alts = opt[1]
opt_arg = opt[2]
@@ -436,7 +436,7 @@ class ArgParser():
col = max(lens)
col += 8 - ((col - 4) & 7)
index = 0
- for opt in self.__arguments:
+ for opt in self.__options:
opt_help = opt[3]
if opt_help is None:
continue