Skip to content

Commit

Permalink
Add help texts to the commands
Browse files Browse the repository at this point in the history
  • Loading branch information
mmerklinger committed Sep 13, 2024
1 parent 55318e2 commit 5e8e671
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions pynitrokey/cli/nk3/piv.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def piv() -> None:
pass


@piv.command()
@piv.command(help="Authenticate with the admin key.")
@click.argument(
"admin-key",
type=click.STRING,
Expand All @@ -45,7 +45,7 @@ def admin_auth(admin_key: str) -> None:
local_print("Authenticated successfully")


@piv.command()
@piv.command(help="Initialize the PIV application.")
@click.argument(
"admin-key",
type=click.STRING,
Expand All @@ -67,7 +67,7 @@ def init(admin_key: str) -> None:
local_print(f"GUID: {guid.hex().upper()}")


@piv.command()
@piv.command(help="Print information about the PIV application.")
def info() -> None:
device = PivApp()
serial_number = device.serial()
Expand All @@ -94,7 +94,7 @@ def info() -> None:
pass


@piv.command()
@piv.command(help="Change the admin key.")
@click.option(
"--current-admin-key",
type=click.STRING,
Expand All @@ -120,7 +120,7 @@ def change_admin_key(current_admin_key: str, new_admin_key: str) -> None:
local_print("Changed key successfully")


@piv.command()
@piv.command(help="Change the PIN.")
@click.option(
"--current-pin",
type=click.STRING,
Expand All @@ -139,7 +139,7 @@ def change_pin(current_pin: str, new_pin: str) -> None:
local_print("Changed pin successfully")


@piv.command()
@piv.command(help="Change the PUK.")
@click.option(
"--current-puk",
type=click.STRING,
Expand All @@ -158,7 +158,7 @@ def change_puk(current_puk: str, new_puk: str) -> None:
local_print("Changed puk successfully")


@piv.command()
@piv.command(help="Reset the retry counter.")
@click.option(
"--puk",
type=click.STRING,
Expand All @@ -177,7 +177,7 @@ def reset_retry_counter(puk: str, new_pin: str) -> None:
local_print("Unlocked PIN successfully")


@piv.command()
@piv.command(help="Reset the PIV application.")
def factory_reset() -> None:
device = PivApp()
try:
Expand Down Expand Up @@ -218,7 +218,7 @@ def factory_reset() -> None:
}


@piv.command()
@piv.command(help="Generate a new key and certificate signing request.")
@click.option(
"--admin-key",
type=click.STRING,
Expand Down Expand Up @@ -565,7 +565,7 @@ def generate_key(
device.send_receive(0xDB, 0x3F, 0xFF, payload)


@piv.command()
@piv.command(help="Write a certificate to a key slot.")
@click.argument(
"admin-key",
type=click.STRING,
Expand Down Expand Up @@ -644,7 +644,7 @@ def write_certificate(admin_key: str, format: str, key: str, path: str) -> None:
device.send_receive(0xDB, 0x3F, 0xFF, payload)


@piv.command()
@piv.command(help="Read a certificate from a key slot.")
@click.option(
"--format",
type=click.Choice(["DER", "PEM"], case_sensitive=False),
Expand Down

0 comments on commit 5e8e671

Please sign in to comment.