diff options
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | README.md | 10 | ||||
-rw-r--r-- | xe.c (renamed from xa.c) | 8 |
3 files changed, 11 insertions, 9 deletions
diff --git a/Makefile b/Makefile index 04700d1..4dc1a2b 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -ALL=xa +ALL=xe CFLAGS=-g -O2 -Wall -Wno-switch -Wextra -Wwrite-strings diff --git a/README.md b/README.md index f806369..9cbab20 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,11 @@ -## xa: simple xargs and apply replacement +## xe: simple xargs and apply replacement -`xa` is a new tool for constructing command lines from file listings +`xe` is a new tool for constructing command lines from file listings or arguments, which includes the best features of `xargs(1)` and `apply(1)`. +`xe` means "execute for every ...". + ## Benefits Over xargs: @@ -19,7 +21,7 @@ Over apply: ## Usage: - xa [-0nv] [-I arg] [-N maxargs] [-j maxjobs] COMMAND... + xe [-0nv] [-I arg] [-N maxargs] [-j maxjobs] COMMAND... | -s SHELLSCRIPT | -a COMMAND... -- ARGS... | -A ARGSEP COMMAND... ARGSEP ARGS... @@ -60,7 +62,7 @@ You can also just copy the binary into your `PATH`. ## Copyright -xa is in the public domain. +xe is in the public domain. To the extent possible under law, Christian Neukirchen <chneukirchen@gmail.com> diff --git a/xa.c b/xe.c index fd1857b..c2606fa 100644 --- a/xa.c +++ b/xe.c @@ -1,5 +1,5 @@ /* - * xa - simple xargs and apply replacement + * xe - simple xargs and apply replacement * * To the extent possible under law, * Christian Neukirchen <chneukirchen@gmail.com> @@ -83,13 +83,13 @@ mywait() if (WEXITSTATUS(status) >= 1 && WEXITSTATUS(status) <= 125) { exit(123); } else if (WEXITSTATUS(status) == 255) { - fprintf(stderr, "xa: %d exited with status 255\n", pid); + fprintf(stderr, "xe: %d exited with status 255\n", pid); exit(124); } else if (WEXITSTATUS(status) > 125) { exit(WEXITSTATUS(status)); } } else if (WIFSIGNALED(status)) { - fprintf(stderr, "xa: %d terminated by signal %d\n", + fprintf(stderr, "xe: %d terminated by signal %d\n", pid, WTERMSIG(status)); exit(125); } @@ -161,7 +161,7 @@ run(char *cmd[]) close(fd); execvp(cmd[0], cmd); } - fprintf(stderr, "xa: %s: %s\n", cmd[0], strerror(errno)); + fprintf(stderr, "xe: %s: %s\n", cmd[0], strerror(errno)); exit(errno == ENOENT ? 127 : 126); } |