Skip to content

Commit

Permalink
Merge branch '118-correct-wording'
Browse files Browse the repository at this point in the history
Make the menu items descriptions more coherent

Fixes #118
  • Loading branch information
szszszsz committed Mar 15, 2022
2 parents d1a23fd + 90edd76 commit d551528
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 24 deletions.
2 changes: 1 addition & 1 deletion pynitrokey/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# copied, modified, or distributed except according to those terms.
#

"""Python Library for Nitrokey FIDO2 & Nitrokey Start."""
"""Python Library for Nitrokey devices."""

import pathlib

Expand Down
4 changes: 2 additions & 2 deletions pynitrokey/cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def nitropy():
logging.basicConfig(format=LOG_FORMAT, level=logging.DEBUG, handlers=[handler])

print(
f"Nitrokey tool for Nitrokey FIDO2, Nitrokey Start, Nitrokey 3 & NetHSM {pynitrokey.__version__}",
f"Command line tool to interact with Nitrokey devices {pynitrokey.__version__}",
file=sys.stderr,
)
check_root()
Expand Down Expand Up @@ -90,7 +90,7 @@ def _list():

@click.command()
def list():
"""List Nitrokey keys (in firmware or bootloader mode)"""
"""List Nitrokey devices (in firmware or bootloader mode)"""
_list()


Expand Down
20 changes: 10 additions & 10 deletions pynitrokey/cli/fido2.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
# https://pocoo-click.readthedocs.io/en/latest/commands/#nested-handling-and-contexts
@click.group()
def fido2():
"""Interact with Nitrokey FIDO2 keys, see subcommands."""
"""Interact with Nitrokey FIDO2 devices, see subcommands."""
pass


Expand Down Expand Up @@ -159,7 +159,7 @@ def mergehex(

@click.group()
def rng():
"""Access TRNG on key, see subcommands."""
"""Access TRNG on device, see subcommands."""
pass


Expand Down Expand Up @@ -474,7 +474,7 @@ def probe(serial, udp, hash_type, filename):
)
@click.option("-y", "--yes", help="Agree to all questions", is_flag=True)
def reset(serial, yes):
"""Reset key - wipes all credentials!!!"""
"""Reset device - wipes all credentials!!!"""
local_print(
"Reset is only possible 10secs after plugging in the device.",
"Please (re-)plug in your Nitrokey FIDO2 now!",
Expand All @@ -501,7 +501,7 @@ def reset(serial, yes):
)
# @click.option("--new-pin", help="change current pin")
def change_pin(serial):
"""Change pin of current key"""
"""Change pin of current device"""

old_pin = AskUser.hidden("Please enter old pin: ")
new_pin = AskUser.hidden("Please enter new pin: ")
Expand Down Expand Up @@ -533,7 +533,7 @@ def change_pin(serial):
)
# @click.option("--new-pin", help="change current pin")
def set_pin(serial):
"""Set pin of current key"""
"""Set pin of current device"""
new_pin = AskUser.hidden("Please enter new pin: ")
confirm_pin = AskUser.hidden("Please confirm new pin: ")
if new_pin != confirm_pin:
Expand Down Expand Up @@ -568,13 +568,13 @@ def set_pin(serial):
"--udp", is_flag=True, default=False, help="Communicate over UDP with software key"
)
def verify(serial, udp):
"""Verify key is valid Nitrokey 'Start' or 'FIDO2' key."""
"""Verify if connected Nitrokey FIDO2 device is genuine."""

# if not pin:
# pin = AskUser("PIN required: ", repeat=0, hide_input=True).ask()

# Any longer and this needs to go in a submodule
local_print("please press the button on your Nitrokey key")
local_print("please press the button on your Nitrokey device")

cert = None
try:
Expand Down Expand Up @@ -649,7 +649,7 @@ def verify(serial, udp):
"--udp", is_flag=True, default=False, help="Communicate over UDP with software key"
)
def version(serial, udp):
"""Version of firmware on key."""
"""Version of firmware on device."""

try:
res = nkfido2.find(serial, udp=udp).solo_version()
Expand Down Expand Up @@ -684,7 +684,7 @@ def version(serial, udp):
"--udp", is_flag=True, default=False, help="Communicate over UDP with software key"
)
def wink(serial, udp):
"""Send wink command to key (blinks LED a few times)."""
"""Send wink command to device (blinks LED a few times)."""

nkfido2.find(serial, udp=udp).wink()

Expand All @@ -699,7 +699,7 @@ def wink(serial, udp):
"--udp", is_flag=True, default=False, help="Communicate over UDP with software key"
)
def reboot(serial, udp):
"""Send reboot command to key (development command)"""
"""Send reboot command to device (development command)"""
local_print("Reboot", "Press key to confirm!")

CTAP_REBOOT = 0x53
Expand Down
2 changes: 1 addition & 1 deletion pynitrokey/cli/nethsm.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def print_table(headers, data):
)
@click.pass_context
def nethsm(ctx, host, version, username, password, verify_tls):
"""Interact with NetHSM, see subcommands."""
"""Interact with NetHSM devices, see subcommands."""
ctx.ensure_object(dict)

ctx.obj["NETHSM_HOST"] = host
Expand Down
8 changes: 4 additions & 4 deletions pynitrokey/cli/nk3/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def await_bootloader(self) -> Nitrokey3Bootloader:
@click.option("-p", "--path", "path", help="The path of the Nitrokey 3 device")
@click.pass_context
def nk3(ctx: click.Context, path: Optional[str]) -> None:
"""Interact with Nitrokey 3, see subcommands."""
"""Interact with Nitrokey 3 devices, see subcommands."""
ctx.obj = Context(path)


Expand Down Expand Up @@ -166,7 +166,7 @@ def _reboot_to_bootloader(device: Nitrokey3Device) -> None:
)
@click.pass_obj
def rng(ctx: Context, length: int) -> None:
"""Generate random data on the key."""
"""Generate random data on the device."""
with ctx.connect_device() as device:
while length > 0:
rng = device.rng()
Expand Down Expand Up @@ -498,7 +498,7 @@ def _perform_update(device: Nitrokey3Bootloader, image: bytes) -> None:
@nk3.command()
@click.pass_obj
def version(ctx: Context) -> None:
"""Query the firmware version of the key."""
"""Query the firmware version of the device."""
with ctx.connect_device() as device:
version = device.version()
local_print(version)
Expand All @@ -507,6 +507,6 @@ def version(ctx: Context) -> None:
@nk3.command()
@click.pass_obj
def wink(ctx: Context) -> None:
"""Send wink command to the key (blinks LED a few times)."""
"""Send wink command to the device (blinks LED a few times)."""
with ctx.connect_device() as device:
device.wink()
2 changes: 1 addition & 1 deletion pynitrokey/cli/pro.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

@click.group()
def pro():
"""Interact with Nitrokey Pro keys, see subcommands."""
"""Interact with Nitrokey Pro devices, see subcommands."""
pass


Expand Down
2 changes: 1 addition & 1 deletion pynitrokey/cli/program.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def program():
)
@click.argument("firmware") # , help="firmware (bundle) to program")
def bootloader(serial, firmware):
"""Program via Nitrokey bootloader interface.
"""Program via Nitrokey FIDO2 bootloader interface.
\b
FIRMWARE argument should be either a .hex or .json file.
Expand Down
2 changes: 1 addition & 1 deletion pynitrokey/cli/start.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
# https://pocoo-click.readthedocs.io/en/latest/commands/#nested-handling-and-contexts
@click.group()
def start():
"""Interact with 'Nitrokey Start' keys, see subcommands."""
"""Interact with Nitrokey Start devices, see subcommands."""
pass


Expand Down
2 changes: 1 addition & 1 deletion pynitrokey/cli/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def connect_nkstorage():

@click.group()
def storage():
"""(experimental) 'Nitrokey Storage' keys, see subcommands."""
"""Interact with Nitrokey Storage devices, see subcommands."""
pass


Expand Down
2 changes: 1 addition & 1 deletion pynitrokey/cli/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
@click.option("-y", "--yes", default=False, is_flag=True, help="agree to everything")
@click.option("-f", "--force", default=False, is_flag=True, help="force")
def update(serial, yes, force):
"""Update Nitrokey key to latest firmware version."""
"""Update Nitrokey FIDO2 device to the latest firmware version."""

# @fixme: print this and allow user to cancel (if not -y is active)
# update_url = 'https://update.nitrokey.com/'
Expand Down
2 changes: 1 addition & 1 deletion pynitrokey/libnk.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ def api(self):

@con_ret_code
def connect(self, path=None, cpu_id=None):
"""base-class uses 'auto' to connect to any key, or by path/id"""
"""base-class uses 'auto' to connect to any device, or by path/id"""
if path:
ret = self.api.NK_connect_with_path(c_enc(path))
elif cpu_id:
Expand Down

0 comments on commit d551528

Please sign in to comment.