This commit is contained in:
Costa Shulyupin 2020-07-20 21:31:40 +03:00
parent 8af8935cb1
commit c0d03886cb
1 changed files with 14 additions and 14 deletions

View File

@ -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('--'):