Skip to content

hkml: print help info instead of exception when no args given#22

Merged
sjp38 merged 1 commit intosjp38:masterfrom
ryncsn:master
Mar 20, 2026
Merged

hkml: print help info instead of exception when no args given#22
sjp38 merged 1 commit intosjp38:masterfrom
ryncsn:master

Conversation

@ryncsn
Copy link
Copy Markdown
Contributor

@ryncsn ryncsn commented Mar 20, 2026

If you run hkml with no args given, it print a exception error:

./hkml
Traceback (most recent call last):
File "/Volumes/Codebase/projects/hackermail/./hkml", line 32, in
if len(sys.argv) > 0 and sys.argv[1] == '--cli_complete':
~~~~~~~~^^^
IndexError: list index out of range

Fix that by print the usage info instead.

Signed-off-by: Kairui Song kasong@tencent.com

If you run hkml with no args given, it print a exception error: ./hkml Traceback (most recent call last): File "/Volumes/Codebase/projects/hackermail/./hkml", line 32, in <module> if len(sys.argv) > 0 and sys.argv[1] == '--cli_complete': ~~~~~~~~^^^ IndexError: list index out of range Fix that by print the usage info instead. Signed-off-by: Kairui Song <kasong@tencent.com>
@sjp38 sjp38 merged commit 39dc81e into sjp38:master Mar 20, 2026
1 check passed
@sjp38
Copy link
Copy Markdown
Owner

sjp38 commented Mar 20, 2026

Nice catch, thank you for this PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants