/* -*-c-*-
*
- * $Id: keyutil.c,v 1.13 2001/02/21 20:04:27 mdw Exp $
+ * $Id: keyutil.c,v 1.15 2003/05/15 23:23:24 mdw Exp $
*
* Simple key manager program
*
/*----- Revision history --------------------------------------------------*
*
* $Log: keyutil.c,v $
+ * 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.
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)
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)
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);
/* --- 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;