Skip to content

Commit

Permalink
Merge pull request #11 from dlundquist/fix-usage
Browse files Browse the repository at this point in the history
Fix usage message
  • Loading branch information
dlundquist committed Feb 29, 2016
2 parents 0949d22 + 2433d01 commit b7452da
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions src/yubiauthadmin
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,23 @@ sub open_store {
return $identity_store->{class}->new($identity_store->{param});
}

my $usage_strings = {
'TOP' => "yubiauthadmin <action> <arguments>\n" .
"Actions:\n" .
"\tlist - lists the yubiauth identities\n".
"\tadd\n",
'list' => "yubiauthadmin list\n" .
"Lists yubikeys in database.\n",
'add' => "yubiauthadmin add <yubikey OTP>\n" .
"Adds a new yubikey to the database, will prompt for AES key and username.\n",
};

sub usage {
my $context = shift;
print STDERR "yubiauthadmin <action> <arguments>\n" .
"Actions:\n" .
"\tlist - lists the yubiauth identities\n".
"\tadd\n";

$context = 'TOP' unless defined $context and exists $usage_strings->{$context};

print STDERR $usage_strings->{$context};

exit 1;
}
Expand Down

0 comments on commit b7452da

Please sign in to comment.