commit - c78f50be073c1324df8ced7730ea3538e92580f4
commit + d015e13193c3f9fbaf95927d9ad99d206a4ce2e2
blob - 27240973130df2f0ca7d57de805a4629cab6811f
blob + 1e7587d8448b2bbc68475e989dca12bf24eb03f3
--- README.md
+++ README.md
Run a command in that directory sandbox:
```sh
-pisol -- your-command --with arguments
+pisol your-command --with arguments
```
-The command receives the caller environment, `PROMPT_ENV_INDICATOR=isolated`,
-and `ISOLATE_ENV` set to the canonical working directory. Calling `pisol -- ...`
+Use `pisol -- COMMAND` when a command name conflicts with a pisol option. The
+command receives the caller environment, `PROMPT_ENV_INDICATOR=isolated`, and
+`ISOLATE_ENV` set to the canonical working directory. Calling `pisol COMMAND`
inside an existing pisol sandbox prints a warning and directly executes the
command rather than creating a nested Landlock domain.
blob - 0966c7b012fa721f124c9d3989f4a31de57a5038
blob + 6700b955a568d39338aef1b7ee0798fd5f529cd4
--- bin/pisol
+++ bin/pisol
pisol_usage() {
cat <<'EOF'
Usage: pisol
+ pisol COMMAND [ARG...]
pisol -- COMMAND [ARG...]
With no arguments, edit the local .isolate configuration.
-With --, execute COMMAND in the current directory Landrun sandbox.
+With a command, execute it in the current directory Landrun sandbox.
+Use -- before commands whose names begin with a hyphen.
EOF
}
fi
;;
*)
- printf 'pisol: unknown option: %s\n' "$1" >&2
- pisol_usage >&2
- exit 2
+ # Treat remaining arguments as the command. -- remains available for
+ # command names that conflict with pisol options.
;;
esac
blob - 719bc22fcae4c29d6dcd4d5cc3af89279fa2ae73
blob + 89789314f9085e56e28497232eb4c24a28d07602
--- doc/pisol.1
+++ doc/pisol.1
.SH SYNOPSIS
.B pisol
.br
+.B pisol
+.I COMMAND
+.RI [ ARG ...]
+.br
.B pisol --
.I COMMAND
.RI [ ARG ...]
.SH DESCRIPTION
.B pisol
opens a Chez Scheme terminal editor for the current directory isolation
-configuration. With
-.BR -- ,
-it replaces itself with
+configuration. With a command, it replaces itself with
.BR landrun (1)
-and executes the command in a working-directory sandbox.
+and executes the command in a working-directory sandbox. Use
+.B --
+before a command whose name conflicts with a pisol option.
.PP
The canonical current directory defines the writable tree. The configuration
path is
blob - 6b778faeb157579442fdc80a46aa8618606bdea4
blob + 09a680f38add099be98173fb824792979f375e2a
--- test/integration.sh
+++ test/integration.sh
)
}
-if run_pisol -- sh -c 'exit 7'; then
- echo "pisol integration: command status was not propagated" >&2
+if run_pisol sh -c 'exit 7'; then
+ echo "pisol integration: direct command status was not propagated" >&2
exit 1
else
status=$?
fi
[ "$before" = "$(cksum "$capture")" ]
+run_pisol --help | grep -F 'pisol COMMAND' >/dev/null
run_pisol --help | grep -F 'pisol -- COMMAND' >/dev/null
rm -f "$project/.isolate"