aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuan J. Martinez <jjm@usebox.net>2019-08-06 21:36:13 +0100
committerJuan J. Martinez <jjm@usebox.net>2019-08-06 21:36:13 +0100
commit7e64309eda023527a0de6afeef24fb463a229d40 (patch)
treec1c2529dc2bace47f048b8992c2830c919cd84a7
parentf340142a7b192086058ea8d7187ce0f0b231560b (diff)
downloadz80count-7e64309eda023527a0de6afeef24fb463a229d40.tar.gz
z80count-7e64309eda023527a0de6afeef24fb463a229d40.zip
More defaults
-rw-r--r--z80count/z80count.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/z80count/z80count.py b/z80count/z80count.py
index ae827f9..a5b1fce 100644
--- a/z80count/z80count.py
+++ b/z80count/z80count.py
@@ -31,6 +31,7 @@ version = "0.7.0"
OUR_COMMENT = re.compile(r"(\[[0-9.\s/]+\])")
DEF_COLUMN = 50
+DEF_TABSTOP = 8
def z80count(line,
@@ -163,7 +164,8 @@ def parse_command_line():
parser.add_argument('-n', dest='no_update', action='store_true',
help="Do not update existing count if available")
parser.add_argument('-T', dest='tab_width', type=int,
- help="Number of spaces for each tab", default=8)
+ help="Number of spaces for each tab (default: %d)" % DEF_TABSTOP,
+ default=DEF_TABSTOP)
parser.add_argument('-t', '--use-tabs', dest='use_tabs', action='store_true',
help="Use tabs to align newly added comments (default: use spaces)")
parser.add_argument('-c', '--column', dest='column', type=int,
@@ -181,10 +183,7 @@ def parse_command_line():
class Parser(object):
-
- """Simple parser based on a table of regexes.
-
- """
+ """Simple parser based on a table of regexes."""
# [label:] OPERATOR [OPERANDS] [; comment]
_LINE_RE = re.compile(r"^([\w]+:)?\s*(?P<operator>\w+)(\s+.*)?$")