commit c6ab8675d8927ff887f37f89282176b40fd303b0
parent a01df0606fd6d2f7675a6c170c8e6e5acdb026d6
Author: Naveen Narayanan zerous <zerous@nocebo.space>
Date: Sat, 23 Dec 2017 16:59:57 +0300
Implement usage(). fix redundant debug check.
Diffstat:
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/pass.c b/pass.c
@@ -44,20 +44,21 @@ delete(char *item)
exit(0);
else if (r == 'y') {
if (remove(file)) {
- if (debug)
logwarn("rm %s", item);
- else {
- fatal("rm %s", item);
}
}
printf("removed '%s'\n", file);
- }
}
void
usage(void)
{
- printf("usage\n");
+ fprintf(stderr,
+ "usage:\tpass init gpg-id\n"
+ "\tpass insert pass-name\n"
+ "\tpass pass-name\n"
+ "\tpass rm pass-name\n"
+ );
exit(0);
}
@@ -369,7 +370,8 @@ main(int argc, char** argv)
else
printpass(*argv);
- }
+ } else
+ usage();
return 0;
}