commit: 50861bc1e07d70ad37a4a9d6c7d3e769c98a2a83
parent c7250c2e64a8bccab55915514887d9a7ccc0ee5b
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Sun, 28 Dec 2025 11:27:06 +0100
env: fix man formatting, update usage string
Diffstat:
2 files changed, 15 insertions(+), 13 deletions(-)
diff --git a/cmd/env.1 b/cmd/env.1
@@ -10,15 +10,15 @@
.Sh SYNOPSIS
.Nm
.Op Fl i
-.Oo Fl C Ar directory
-.Oo Fl u Ar name Oc Ns ...
-.Oo Ar name Ns = Ns Ar value Oc Ns ...
+.Op Fl C Ar dir
+.Oo Fl u Ar key Oc Ns ...
+.Oo Ar key Ns = Ns Ar value Oc Ns ...
.Op Ar command Op Ar argument...
.Nm
.Op Fl i
-.Oo Fl C Ar directory
-.Oo Fl u Ar name Oc Ns ...
-.Oo Ar name Ns = Ns Ar value Oc Ns ...
+.Op Fl C Ar dir
+.Oo Fl u Ar key Oc Ns ...
+.Oo Ar key Ns = Ns Ar value Oc Ns ...
.Fl S Ar command_string
.Sh DESCRIPTION
.Nm
@@ -30,19 +30,19 @@ and otherwise prints the environment.
.Pp
The environment can be modified via the following options:
.Bl -tag -width Ds
-.It Fl C Ar directory
+.It Fl C Ar dir
Change workding directory into
-.Ar directory
+.Ar dir
before executing the specified command.
.It Fl i
Ignore the existing environment.
-.It Fl u Ar name
+.It Fl u Ar key
Removes the variable named
-.Ar name
+.Ar key
from the new environment.
-.It Ar name Ns = Ns Ar value
+.It Ar key Ns = Ns Ar value
Adds the variable named
-.Ar name
+.Ar key
with the value
.Ar value
into the new environment, it cannot itself contain the
diff --git a/cmd/env.c b/cmd/env.c
@@ -47,7 +47,9 @@ do_export(void)
static void
usage(void)
{
- fprintf(stderr, "env [-i] [-u key] [key=value ...] [command [args]]\n");
+ fprintf(stderr,
+ "Usage: env [-i] [-C dir] [-u key] [key=value ...] [command [args]]\n"
+ " env [-i] [-C dir] [-u key] [key=value ...] -S command_string\n");
}
int