From 83f5c24ba52ce14047397663581d060fe46286c0 Mon Sep 17 00:00:00 2001 From: micgre93 Date: Tue, 9 Jul 2024 15:35:46 -0600 Subject: [PATCH] Added a help message --- contain | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/contain b/contain index 213cf8c..e1bd0ed 100755 --- a/contain +++ b/contain @@ -2,15 +2,21 @@ +# "Parse" +USAGE="Usage: $0 program arg1 arg2 ... +Prevent 'program' from spawning child processes that persist after it exits. +See https://github.com/BYUHPC/contain for details." +[[ "$1" = -h || "$1" = --help ]] && echo "$USAGE" && exit + + + # Create container directory and environment file container="$(mktemp -d -t contain-rootfs-XXXXXX)" -container_env="${container/rootfs/environment}" -printenv > "$container_env" -trap 'rm -rf "$container" "$container_env"' EXIT +trap 'rm -rf "$container"' EXIT -# Environment variables to be passed to the container +# Environment variables to be passed into the container envvars=() while IFS= read -r -d '' VAR; do # Apptainer can't handle funky variable names :/