Skip to content
This repository was archived by the owner on Oct 1, 2025. It is now read-only.
This repository was archived by the owner on Oct 1, 2025. It is now read-only.

Add user-friendly error message to generatekeys.py #44

@aaaaalbert

Description

@aaaaalbert

While generatekeys.py isn't the most-often used script in our repos, it should nevertheless print meaningful information when called with wrong or too little arguments. Let usage() functions in other code inspire you.

albert$ python generatekeys.py 
Traceback (most recent call last):
  File "generatekeys.py", line 14, in <module>
    pubfn = sys.argv[1]+'.publickey'
IndexError: list index out of range
albert$ python generatekeys.py keyname abcdef
Traceback (most recent call last):
  File "generatekeys.py", line 18, in <module>
    keylength = int(sys.argv[2])
ValueError: invalid literal for int() with base 10: 'abcdef'

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions