cli: rename 'list' command to 'readers'; improve usage

There are going to be several `list` commands (e.g. `yubikey keys list`)
so this is a confusing name.

If we need more than one `readers` subcommand we can change this to be
`readers list` eventually.

Separately (in what probably should've been its own commit, mea culpa)
this adds slightly better usage.
This commit is contained in:
Tony Arcieri
2019-12-09 09:23:40 -08:00
parent fd77ba6e74
commit 55d077dd80
4 changed files with 45 additions and 18 deletions
@@ -4,12 +4,12 @@ use gumdrop::Options;
use std::process::exit;
use yubikey_piv::readers::Readers;
/// The `list` subcommand
/// The `readers` subcommand
#[derive(Debug, Options)]
pub struct ListCmd {}
pub struct ReadersCmd {}
impl ListCmd {
/// Run the `list` subcommand
impl ReadersCmd {
/// Run the `readers` subcommand
pub fn run(&self) {
let mut readers = Readers::open().unwrap_or_else(|e| {
status_err!("couldn't open PC/SC context: {}", e);