Skip to content

Commit fdf16a6

Browse files
author
Bin Zhang
committed
Merge pull request cocos2d#153 from natural-law/develop
Modify the return code of "cocos -h" from -1 to 0.
2 parents 802e261 + b1bbed2 commit fdf16a6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

bin/cocos.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,6 @@ def help():
481481
print("\nExample:")
482482
print("\t%s new --help" % sys.argv[0])
483483
print("\t%s run --help" % sys.argv[0])
484-
sys.exit(-1)
485484

486485
def run_plugin(command, argv, plugins):
487486
run_directly = False
@@ -523,8 +522,9 @@ def _check_python_version():
523522

524523
if len(sys.argv) == 1 or sys.argv[1] in ('-h', '--help'):
525524
help()
525+
exit(0)
526526

527-
if len(sys.argv) == 1 or sys.argv[1] in ('-v', '--version'):
527+
if len(sys.argv) > 1 and sys.argv[1] in ('-v', '--version'):
528528
print("%s" % COCOS2D_CONSOLE_VERSION)
529529
exit(0)
530530

0 commit comments

Comments
 (0)