diff options
-rw-r--r-- | src/execline/background.c | 6 | ||||
-rw-r--r-- | src/execline/backtick.c | 4 | ||||
-rw-r--r-- | src/execline/define.c | 4 | ||||
-rw-r--r-- | src/execline/dollarat.c | 4 | ||||
-rw-r--r-- | src/execline/elglob.c | 4 | ||||
-rw-r--r-- | src/execline/fdclose.c | 4 | ||||
-rw-r--r-- | src/execline/fdmove.c | 4 | ||||
-rw-r--r-- | src/execline/fdswap.c | 4 | ||||
-rw-r--r-- | src/execline/foreground.c | 2 | ||||
-rw-r--r-- | src/execline/getpid.c | 8 | ||||
-rw-r--r-- | src/execline/heredoc.c | 6 | ||||
-rw-r--r-- | src/execline/homeof.c | 4 | ||||
-rw-r--r-- | src/execline/if.c | 4 | ||||
-rw-r--r-- | src/execline/importas.c | 4 | ||||
-rw-r--r-- | src/execline/pipeline.c | 6 | ||||
-rw-r--r-- | src/execline/redirfd.c | 4 |
16 files changed, 36 insertions, 36 deletions
diff --git a/src/execline/background.c b/src/execline/background.c index e8def5b..06fadd5 100644 --- a/src/execline/background.c +++ b/src/execline/background.c @@ -10,14 +10,14 @@ #include <skalibs/types.h> #include <execline/execline.h> -#define USAGE "background [ -d ] { command... }" +#define USAGE "& [ -d ] { command... }" int main (int argc, char const **argv, char const *const *envp) { pid_t pid ; int argc1 ; int df = 0 ; - PROG = "background" ; + PROG = "&" ; { subgetopt_t l = SUBGETOPT_ZERO ; for (;;) @@ -45,7 +45,7 @@ int main (int argc, char const **argv, char const *const *envp) { case -1: strerr_diefu1sys(111, "doublefork") ; case 0: - PROG = "background (grandchild)" ; + PROG = "& (grandchild)" ; pathexec0_run(argv, envp) ; strerr_dieexec(errno == ENOENT ? 127 : 126, argv[0]) ; } diff --git a/src/execline/backtick.c b/src/execline/backtick.c index a2054ec..054b141 100644 --- a/src/execline/backtick.c +++ b/src/execline/backtick.c @@ -9,7 +9,7 @@ #include <skalibs/djbunix.h> #include <execline/execline.h> -#define USAGE "backtick [ -i | -I | -D default ] [ -n ] var { prog... } remainder..." +#define USAGE "` [ -i | -I | -D default ] [ -n ] var { prog... } remainder..." #define dieusage() strerr_dieusage(100, USAGE) int main (int argc, char const **argv, char const *const *envp) @@ -21,7 +21,7 @@ int main (int argc, char const **argv, char const *const *envp) size_t modifstart ; int insist = 0, chomp = 0 ; char const *def = 0 ; - PROG = "backtick" ; + PROG = "`" ; for (;;) { int opt = subgetopt_r(argc, argv, "iInD:", &localopt) ; diff --git a/src/execline/define.c b/src/execline/define.c index f87c531..4b40a85 100644 --- a/src/execline/define.c +++ b/src/execline/define.c @@ -3,10 +3,10 @@ #include <skalibs/strerr2.h> #include "exlsn.h" -#define USAGE "define [ -n ] [ -s ] [ -C | -c ] [ -d delim ] key value prog..." +#define USAGE "= [ -n ] [ -s ] [ -C | -c ] [ -d delim ] key value prog..." int main (int argc, char const **argv, char const *const *envp) { - PROG = "define" ; + PROG = "=" ; exlsn_main(argc, argv, envp, &exlsn_define, USAGE) ; } diff --git a/src/execline/dollarat.c b/src/execline/dollarat.c index 5bc5c1f..b73fbf0 100644 --- a/src/execline/dollarat.c +++ b/src/execline/dollarat.c @@ -9,7 +9,7 @@ #include <skalibs/types.h> #include <skalibs/netstring.h> -#define USAGE "dollarat [ -n ] [ -0 | -d delimchar ]" +#define USAGE "$@ [ -n ] [ -0 | -d delimchar ]" int main (int argc, char const *const *argv) { @@ -18,7 +18,7 @@ int main (int argc, char const *const *argv) char delim = '\n' ; int zero = 0 ; int nl = 1 ; - PROG = "dollarat" ; + PROG = "$@" ; { subgetopt_t l = SUBGETOPT_ZERO ; for (;;) diff --git a/src/execline/elglob.c b/src/execline/elglob.c index ffff74a..6eea5c0 100644 --- a/src/execline/elglob.c +++ b/src/execline/elglob.c @@ -3,10 +3,10 @@ #include <skalibs/strerr2.h> #include "exlsn.h" -#define USAGE "elglob [ -v ] [ -w ] [ -s ] [ -m ] [ -e ] [ -0 ] key pattern prog..." +#define USAGE "* [ -v ] [ -w ] [ -s ] [ -m ] [ -e ] [ -0 ] key pattern prog..." int main (int argc, char const **argv, char const *const *envp) { - PROG = "elglob" ; + PROG = "*" ; exlsn_main(argc, argv, envp, &exlsn_elglob, USAGE) ; } diff --git a/src/execline/fdclose.c b/src/execline/fdclose.c index e74c772..d539847 100644 --- a/src/execline/fdclose.c +++ b/src/execline/fdclose.c @@ -4,12 +4,12 @@ #include <skalibs/strerr2.h> #include <skalibs/djbunix.h> -#define USAGE "fdclose fd prog..." +#define USAGE ">&- fd prog..." int main (int argc, char const *const *argv, char const *const *envp) { unsigned int fd ; - PROG = "fdclose" ; + PROG = ">&-" ; if ((argc < 3) || !uint0_scan(argv[1], &fd)) strerr_dieusage(100, USAGE) ; fd_close(fd) ; xpathexec_run(argv[2], argv+2, envp) ; diff --git a/src/execline/fdmove.c b/src/execline/fdmove.c index 41e2cf1..584719c 100644 --- a/src/execline/fdmove.c +++ b/src/execline/fdmove.c @@ -5,13 +5,13 @@ #include <skalibs/strerr2.h> #include <skalibs/djbunix.h> -#define USAGE "fdmove [ -c ] to from prog..." +#define USAGE ">& [ -c ] to from prog..." int main (int argc, char const *const *argv, char const *const *envp) { unsigned int to, from ; int flagcopy = 0 ; - PROG = "fdmove" ; + PROG = ">&" ; { subgetopt_t l = SUBGETOPT_ZERO ; for (;;) diff --git a/src/execline/fdswap.c b/src/execline/fdswap.c index 57cf4f6..a8a761c 100644 --- a/src/execline/fdswap.c +++ b/src/execline/fdswap.c @@ -4,12 +4,12 @@ #include <skalibs/strerr2.h> #include <skalibs/djbunix.h> -#define USAGE "fdswap fd1 fd2 prog..." +#define USAGE "<> fd1 fd2 prog..." int main (int argc, char const *const *argv, char const *const *envp) { unsigned int fd1, fd2 ; - PROG = "fdswap" ; + PROG = "<>" ; if ((argc < 4) || !uint0_scan(argv[1], &fd1) || !uint0_scan(argv[2], &fd2)) strerr_dieusage(100, USAGE) ; if (fd_move2(fd1, fd2, fd2, fd1) < 0) strerr_diefu1sys(111, "swap fds") ; diff --git a/src/execline/foreground.c b/src/execline/foreground.c index 8164dcb..f7c4c47 100644 --- a/src/execline/foreground.c +++ b/src/execline/foreground.c @@ -6,7 +6,7 @@ int main (int argc, char const **argv, char const *const *envp) { int argc1 ; - PROG = "foreground" ; + PROG = ";" ; argc1 = el_semicolon(++argv) ; if (argc1 >= --argc) strerr_dief1x(100, "unterminated block") ; argv[argc1] = 0 ; diff --git a/src/execline/getpid.c b/src/execline/getpid.c index 0272b16..fbb0a4a 100644 --- a/src/execline/getpid.c +++ b/src/execline/getpid.c @@ -7,22 +7,22 @@ #include <skalibs/env.h> #include <skalibs/djbunix.h> -#define USAGE "getpid variable prog..." +#define USAGE "! variable prog..." int main (int argc, char const *const *argv, char const *const *envp) { size_t len ; - PROG = "getpid" ; + PROG = "!" ; if (argc < 3) strerr_dieusage(100, USAGE) ; len = strlen(argv[1]) ; if (memchr(argv[1], '=', len)) strerr_dief2x(100, "invalid variable name: ", argv[1]) ; { size_t i = len+1 ; - char fmt[UINT_FMT + len + 2] ; + char fmt[PID_FMT + len + 2] ; memcpy(fmt, argv[1], len) ; fmt[len] = '=' ; - i += uint_fmt(fmt+i, getpid()) ; fmt[i++] = 0 ; + i += pid_fmt(fmt+i, getpid()) ; fmt[i++] = 0 ; xpathexec_r(argv+2, envp, env_len(envp), fmt, i) ; } } diff --git a/src/execline/heredoc.c b/src/execline/heredoc.c index d28d765..8935312 100644 --- a/src/execline/heredoc.c +++ b/src/execline/heredoc.c @@ -9,13 +9,13 @@ #include <skalibs/strerr2.h> #include <skalibs/djbunix.h> -#define USAGE "heredoc [ -d ] fd string command..." +#define USAGE "<< [ -d ] fd string command..." #define dieusage() strerr_dieusage(100, USAGE) int main (int argc, char const *const *argv, char const *const *envp) { int df = 0 ; - PROG = "heredoc" ; + PROG = "<<" ; { subgetopt_t l = SUBGETOPT_ZERO ; for (;;) @@ -44,7 +44,7 @@ int main (int argc, char const *const *argv, char const *const *envp) case 0: { size_t len = strlen(argv[1]) ; - PROG = "heredoc (child)" ; + PROG = "<< (child)" ; fd_close(fd[0]) ; if (allwrite(fd[1], argv[1], len) < len) strerr_diefu1sys(111, "allwrite") ; diff --git a/src/execline/homeof.c b/src/execline/homeof.c index 40463da..cb92c11 100644 --- a/src/execline/homeof.c +++ b/src/execline/homeof.c @@ -6,12 +6,12 @@ #include <skalibs/buffer.h> #include <skalibs/strerr2.h> -#define USAGE "homeof user" +#define USAGE "~ user" int main (int argc, char const *const *argv) { struct passwd *pw ; - PROG = "homeof" ; + PROG = "~" ; if (argc < 2) strerr_dieusage(100, USAGE) ; pw = getpwnam(argv[1]) ; if (!pw) diff --git a/src/execline/if.c b/src/execline/if.c index 037d4a2..a65494b 100644 --- a/src/execline/if.c +++ b/src/execline/if.c @@ -7,7 +7,7 @@ #include <skalibs/djbunix.h> #include <execline/execline.h> -#define USAGE "if [ -n ] [ -X ] [ -t | -x exitcode ] { command... }" +#define USAGE "&& [ -n ] [ -X ] [ -t | -x exitcode ] { command... }" int main (int argc, char const **argv, char const *const *envp) { @@ -15,7 +15,7 @@ int main (int argc, char const **argv, char const *const *envp) pid_t pid ; int not = 0, flagnormalcrash = 0 ; unsigned short e = 1 ; - PROG = "if" ; + PROG = "&&" ; { subgetopt_t l = SUBGETOPT_ZERO ; for (;;) diff --git a/src/execline/importas.c b/src/execline/importas.c index 4011c83..3c0b8ab 100644 --- a/src/execline/importas.c +++ b/src/execline/importas.c @@ -3,10 +3,10 @@ #include <skalibs/strerr2.h> #include "exlsn.h" -#define USAGE "importas [ -i | -D default ] [ -u ] [ -n ] [ -s ] [ -C | -c ] [ -d delim ] key var prog..." +#define USAGE "$ [ -i | -D default ] [ -u ] [ -n ] [ -s ] [ -C | -c ] [ -d delim ] key var prog..." int main (int argc, char const **argv, char const *const *envp) { - PROG = "importas" ; + PROG = "$" ; exlsn_main(argc, argv, envp, &exlsn_importas, USAGE) ; } diff --git a/src/execline/pipeline.c b/src/execline/pipeline.c index f61c35b..9458380 100644 --- a/src/execline/pipeline.c +++ b/src/execline/pipeline.c @@ -10,13 +10,13 @@ #include <skalibs/djbunix.h> #include <execline/execline.h> -#define USAGE "pipeline [ -d ] [ -r | -w ] { command... } command..." +#define USAGE "| [ -d ] [ -r | -w ] { command... } command..." #define dieusage() strerr_dieusage(100, USAGE) int main (int argc, char const **argv, char const *const *envp) { int df = 0, w = 0 ; - PROG = "pipeline" ; + PROG = "|" ; { subgetopt_t l = SUBGETOPT_ZERO ; for (;;) @@ -49,7 +49,7 @@ int main (int argc, char const **argv, char const *const *envp) { case -1: strerr_diefu1sys(111, "doublefork") ; case 0: - PROG = "pipeline (grandchild)" ; + PROG = "| (grandchild)" ; fd_close(p[w]) ; if (fd_move(!w, p[!w]) < 0) strerr_diefu1sys(111, "fd_move") ; pathexec0_run(argv, envp) ; diff --git a/src/execline/redirfd.c b/src/execline/redirfd.c index 93e1582..3ebef8c 100644 --- a/src/execline/redirfd.c +++ b/src/execline/redirfd.c @@ -7,7 +7,7 @@ #include <skalibs/strerr2.h> #include <skalibs/djbunix.h> -#define USAGE "redirfd -[ r | w | u | a | c | x ] [ -n ] [ -b ] fd file prog..." +#define USAGE "< -[ r | w | u | a | c | x ] [ -n ] [ -b ] fd file prog..." #define dieusage() strerr_dieusage(100, USAGE) int main (int argc, char const *const *argv, char const *const *envp) @@ -16,7 +16,7 @@ int main (int argc, char const *const *argv, char const *const *envp) unsigned int flags = 0 ; int what = -1 ; int changemode = 0 ; - PROG = "redirfd" ; + PROG = "<" ; { subgetopt_t l = SUBGETOPT_ZERO ; for (;;) |