Improve behaviour regarding "help" (#509)
Also accept -h for help. This is the usual behaviour of most utils that accept --help. Also, now an empty call to ./emsdk does not print the full help, as discussed in #509.
This commit is contained in:
8
emsdk.py
8
emsdk.py
@@ -2677,10 +2677,10 @@ def error_on_missing_tool(name):
|
|||||||
def main():
|
def main():
|
||||||
global emscripten_config_directory, BUILD_FOR_TESTING, ENABLE_LLVM_ASSERTIONS, TTY_OUTPUT
|
global emscripten_config_directory, BUILD_FOR_TESTING, ENABLE_LLVM_ASSERTIONS, TTY_OUTPUT
|
||||||
|
|
||||||
if len(sys.argv) <= 1 or sys.argv[1] == 'help' or sys.argv[1] == '--help':
|
|
||||||
if len(sys.argv) <= 1:
|
if len(sys.argv) <= 1:
|
||||||
print(' emsdk: No command given. Please call one of the following:')
|
print("Missing command; Type 'emsdk help' to get a list of commands.")
|
||||||
else:
|
return 1
|
||||||
|
if sys.argv[1] in ('help', '--help', '-h'):
|
||||||
print(' emsdk: Available commands:')
|
print(' emsdk: Available commands:')
|
||||||
|
|
||||||
print('''
|
print('''
|
||||||
@@ -2798,7 +2798,7 @@ def main():
|
|||||||
'activate' commands and the invocation of 'emsdk_env', or otherwise
|
'activate' commands and the invocation of 'emsdk_env', or otherwise
|
||||||
these commands will default to operating on the default build type
|
these commands will default to operating on the default build type
|
||||||
which in and RelWithDebInfo.''')
|
which in and RelWithDebInfo.''')
|
||||||
return 1
|
return 0
|
||||||
|
|
||||||
# Extracts a boolean command line argument from sys.argv and returns True if it was present
|
# Extracts a boolean command line argument from sys.argv and returns True if it was present
|
||||||
def extract_bool_arg(name):
|
def extract_bool_arg(name):
|
||||||
|
|||||||
Reference in New Issue
Block a user