Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nethsm: Read host from NETHSM_HOST if not set #617

Merged
merged 1 commit into from
Jan 20, 2025
Merged

Conversation

robin-nitrokey
Copy link
Member

This patch changes all nethsm commands to read the host from the NETHSM_HOST environment variable if it is not set on the command line. This has two benefits: It makes it easier to run multiple commands for the same host. And it fixes the problem that the required --host option on the nethsm command group would make it impossible to run --help for a subcommand without setting --host.

Example output if neither is set:

$ nitropy nethsm lock
Command line tool to interact with Nitrokey devices 0.7.3
Critical error:
Missing NetHSM host: set the --host option or the NETHSM_HOST environment variable

This patch changes all nethsm commands to read the host from the
NETHSM_HOST environment variable if it is not set on the command line.
This has two benefits:  It makes it easier to run multiple commands for
the same host.  And it fixes the problem that the required --host option
on the nethsm command group would make it impossible to run --help for
a subcommand without setting --host.

Example output if neither is set:

    $ nitropy nethsm lock
    Command line tool to interact with Nitrokey devices 0.7.3
    Critical error:
    Missing NetHSM host: set the --host option or the NETHSM_HOST environment variable
@robin-nitrokey robin-nitrokey merged commit 22acf35 into master Jan 20, 2025
18 checks passed
@robin-nitrokey robin-nitrokey deleted the nethsm-host branch January 20, 2025 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants