traceflags: fix --trace-help

This commit is contained in:
Nathan Binkert 2009-02-15 20:39:12 -08:00
parent de72083805
commit e0f425bb94
3 changed files with 19 additions and 18 deletions

View file

@ -38,19 +38,6 @@ from options import OptionParser
__all__ = [ 'options', 'arguments', 'main' ]
def print_list(items, indent=4):
line = ' ' * indent
for i,item in enumerate(items):
if len(line) + len(item) > 76:
print line
line = ' ' * indent
if i < len(items) - 1:
line += '%s, ' % item
else:
line += item
print line
usage="%prog [m5 options] script.py [script options]"
version="%prog 2.0"
brief_copyright='''

View file

@ -28,6 +28,7 @@
import internal
import traceflags as flags
import util
from internal.trace import clear, output, set, ignore
@ -36,13 +37,13 @@ def enable():
def help():
print "Base Flags:"
for flag in trace.flags.basic:
print " %s: %s" % (flag, trace.flags.descriptions[flag])
for flag in flags.basic:
print " %s: %s" % (flag, flags.descriptions[flag])
print
print "Compound Flags:"
for flag in trace.flags.compound:
for flag in flags.compound:
if flag == 'All':
continue
print " %s: %s" % (flag, trace.flags.descriptions[flag])
print_list(trace.flags.compoundMap[flag], indent=8)
print " %s: %s" % (flag, flags.descriptions[flag])
util.print_list(flags.compoundMap[flag], indent=8)
print

View file

@ -30,3 +30,16 @@ from attrdict import attrdict, optiondict
from misc import *
from multidict import multidict
import jobfile
def print_list(items, indent=4):
line = ' ' * indent
for i,item in enumerate(items):
if len(line) + len(item) > 76:
print line
line = ' ' * indent
if i < len(items) - 1:
line += '%s, ' % item
else:
line += item
print line