commit 3e412fe4c8e5d07719064bf2fa7674ed433c883b
parent 215011517d034bf93eb99650932b270e3473a4f8
Author: Cem Keylan <cem@ckyln.com>
Date: Fri, 15 May 2020 17:03:56 +0300
bin: accept '--help' arguments
Diffstat:
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/bin/kiss-readlink.c b/bin/kiss-readlink.c
@@ -4,12 +4,13 @@
// This is basically a 'readlink -f' command.
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
int main(int argc, char *argv[]) {
char buf[512];
- if (argc != 2) {
+ if (argc != 2 || strcmp(argv[1], "--help") == 0) {
printf("usage: %s <file>\n", argv[0]);
return(1);
}
diff --git a/bin/kiss-stat.c b/bin/kiss-stat.c
@@ -9,12 +9,13 @@
#include <pwd.h>
#include <sys/stat.h>
#include <stdio.h>
+#include <string.h>
int main (int argc, char *argv[]) {
struct stat sb;
// Exit if no or multiple arguments are given
- if (argc != 2) {
+ if (argc != 2 || strcmp(argv[1], "--help") == 0) {
fprintf(stderr, "Usage: %s <pathname>\n", argv[0]);
return(1);
}