X-Git-Url: https://git.distorted.org.uk/u/mdw/catacomb/blobdiff_plain/ce70ec47fb1c7dabeccfafbd93fa47e0b4c6c8ad..1e7fadef79b5323be0de5084f3927e00ff413abe:/keyutil.c diff --git a/keyutil.c b/keyutil.c index 80278ad..1871c1a 100644 --- a/keyutil.c +++ b/keyutil.c @@ -1,6 +1,6 @@ /* -*-c-*- * - * $Id: keyutil.c,v 1.13 2001/02/21 20:04:27 mdw Exp $ + * $Id: keyutil.c,v 1.16 2003/10/15 09:31:45 mdw Exp $ * * Simple key manager program * @@ -30,6 +30,15 @@ /*----- Revision history --------------------------------------------------* * * $Log: keyutil.c,v $ + * Revision 1.16 2003/10/15 09:31:45 mdw + * Fix help message. + * + * Revision 1.15 2003/05/15 23:23:24 mdw + * Fix behaviour with bogus trailing attributes. + * + * Revision 1.14 2001/02/23 09:03:27 mdw + * Simplify usage message by removing nonexistant options. + * * Revision 1.13 2001/02/21 20:04:27 mdw * Provide help on individual commands (some need it desparately). Allow * atomic retagging of keys. @@ -171,8 +180,11 @@ static void setattr(key_file *f, key *k, char *v[]) int err; char *p = *v; size_t eq = strcspn(p, "="); - if (p[eq] == 0) - moan("invalid assignment: `%s'", p); + if (!p[eq]) { + moan("invalid assignment: `%s' (ignored)", p); + v++; + continue; + } p[eq] = 0; p += eq + 1; if ((err = key_putattr(f, k, *v, *p ? p : 0)) != 0) @@ -1693,7 +1705,7 @@ static cmd *findcmd(const char *name) void usage(FILE *fp) { - pquis(fp, "Usage: $ [-k file] [-i tag] [-t type] command [args]\n"); + pquis(fp, "Usage: $ [-k keyring] command [args]\n"); } void version(FILE *fp) @@ -1709,14 +1721,12 @@ void help(FILE *fp, char **argv) fputc('\n', fp); if (*argv) { c = findcmd(*argv); - fprintf(fp, "Usage: %s [-options] %s\n", QUIS, c->usage); + fprintf(fp, "Usage: %s [-k keyring] %s\n", QUIS, c->usage); if (c->help) { fputc('\n', fp); fputs(c->help, fp); } } else { - version(fp); - fputc('\n', fp); usage(fp); fputs("\n\ Performs various simple key management operations. Command line options\n\ @@ -1772,14 +1782,12 @@ int main(int argc, char *argv[]) /* --- Real live useful options --- */ { "keyring", OPTF_ARGREQ, 0, 'k' }, - { "id", OPTF_ARGREQ, 0, 'i' }, - { "type", OPTF_ARGREQ, 0, 't' }, /* --- Magic terminator --- */ { 0, 0, 0, 0 } }; - int i = mdwopt(argc, argv, "+hvu k:i:t:", opt, 0, 0, 0); + int i = mdwopt(argc, argv, "+hvu k:", opt, 0, 0, 0); if (i < 0) break;