From f2a12b137607a4b1c35729178fe2406c81095291 Mon Sep 17 00:00:00 2001 From: Valentin Lab Date: Mon, 31 Jan 2022 10:54:02 +0100 Subject: [PATCH] new: add ``--get-project-name`` option to query project name Signed-off-by: Valentin Lab --- bin/compose-core | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bin/compose-core b/bin/compose-core index dc23774..780b690 100755 --- a/bin/compose-core +++ b/bin/compose-core @@ -3683,6 +3683,8 @@ display_help() { echo " (ignoring any other options)" echo " --dirs Display data dirs and quit" echo " (ignoring any other options)" + echo " --get-project-name Display project name and quit" + echo " (ignoring any other options)" echo " -v, --verbose Be more verbose" echo " -q, --quiet Be quiet" echo " -d, --debug Print full debugging information (sets also verbose)" @@ -4016,6 +4018,11 @@ while read-0 arg; do echo "VARDIR: $VARDIR" exit 0 ;; + --get-project-name) + project=$(get_default_project_name) || return 1 + echo "$project" + exit 0 + ;; --dry-compose-run) export DRY_COMPOSE_RUN=true ;;