forked from OpenSDV/Linux_Kernel_map4vehicle
*usage
This commit is contained in:
parent
8af8935cb1
commit
c0d03886cb
28
srcxray.py
28
srcxray.py
|
@ -1214,9 +1214,20 @@ def doxygen_length(a):
|
||||||
|
|
||||||
|
|
||||||
def usage():
|
def usage():
|
||||||
print("\nTry this:\n")
|
#print('Run', me, 'usage')
|
||||||
print("cd linux/init")
|
for m in getmembers(modules[__name__]):
|
||||||
print(me, "unittest")
|
if isfunction(m[1]) and m[1].__module__ == __name__:
|
||||||
|
d = inspect.getdoc(m[1])
|
||||||
|
if not d:
|
||||||
|
continue
|
||||||
|
print('\n' + d.replace('Arg:', '\033[1m' + m[1].__name__ + '\033[0m').
|
||||||
|
replace('Ex:',
|
||||||
|
'\033[3mExample usage:\033[0m\n' + me + ' ' + m[1].__name__).
|
||||||
|
replace('Ex2:',
|
||||||
|
'\033[3mExample usage:\033[0m\n' + me)
|
||||||
|
)
|
||||||
|
print("\nTry this: ")
|
||||||
|
print("cd linux/init;", me, "unittest")
|
||||||
print("\nEmergency termination: ^Z, kill %1")
|
print("\nEmergency termination: ^Z, kill %1")
|
||||||
print()
|
print()
|
||||||
|
|
||||||
|
@ -1250,17 +1261,6 @@ def main():
|
||||||
try:
|
try:
|
||||||
ret = False
|
ret = False
|
||||||
if len(sys.argv) == 1:
|
if len(sys.argv) == 1:
|
||||||
#print('Run', me, 'usage')
|
|
||||||
for m in getmembers(modules[__name__]):
|
|
||||||
if isfunction(m[1]) and m[1].__module__ == __name__:
|
|
||||||
d = inspect.getdoc(m[1])
|
|
||||||
if not d:
|
|
||||||
continue
|
|
||||||
print('\n' + d.replace('Arg:', '\033[1m' + m[1].__name__ + '\033[0m').
|
|
||||||
replace('Ex:', '\033[3mExample usage:\033[0m\n' + me +
|
|
||||||
' ' + m[1].__name__).
|
|
||||||
replace('Ex2:', '\033[3mExample usage:\033[0m\n' + me + ' ')
|
|
||||||
)
|
|
||||||
usage()
|
usage()
|
||||||
else:
|
else:
|
||||||
while sys.argv[1].startswith('--'):
|
while sys.argv[1].startswith('--'):
|
||||||
|
|
Loading…
Reference in New Issue