+void find_keys(char *search, uint64_t keyid, bool ishex,
+ bool fingerprint, bool exact, bool verbose)
+{
+ struct openpgp_publickey *publickey = NULL;
+ int count = 0;
+
+ if (ishex) {
+ count = fetch_key(keyid, &publickey, false);
+ } else {
+ count = fetch_key_text(search, &publickey);
+ }
+ if (publickey != NULL) {
+ key_index(publickey, verbose, fingerprint, false);
+ free_publickey(publickey);
+ } else if (count == 0) {
+ puts("Key not found.");
+ } else {
+ printf("Found %d keys, but maximum number to return is %d.\n",
+ count,
+ config.maxkeys);
+ puts("Try again with a more specific search.");
+ }
+}
+
+void usage(void) {
+ puts("onak " VERSION " - an OpenPGP keyserver.\n");
+ puts("Usage:\n");
+ puts("\tonak [options] <command> <parameters>\n");
+ puts("\tCommands:\n");
+ puts("\tadd - read armored OpenPGP keys from stdin and add to the keyserver");
+ puts("\tdelete - delete a given key from the keyserver");
+ puts("\tget - retrieves the key requested from the keyserver");
+ puts("\tindex - search for a key and list it");
+ puts("\tvindex - search for a key and list it and its signatures");
+}