Skip to content

Commit

Permalink
cqfd: fix run -c without argument
Browse files Browse the repository at this point in the history
This errors if no argument is given to run -c.
  • Loading branch information
gportay committed Jan 30, 2025
1 parent 83eef2e commit 307d232
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions support/cqfd
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
#
# Copyright 2024 Gaël PORTAY
# Copyright 2024-2025 Gaël PORTAY
#
# SPDX-License-Identifier: LGPL-2.1-or-later
#
Expand Down Expand Up @@ -171,7 +171,12 @@ then
exec "${DOSH[@]:-dosh}" --rebuild --dockerfile "$dockerfile" --no-doshrc --no-doshprofile </dev/null
fi
if [[ "$cmd_run" ]] && [[ "$1" = -c ]]
if [[ "$cmd_run" ]] && [[ "$1" = -c ]] && [[ "$#" -eq 1 ]]
then
usage
echo "Error: run -c: Too few arguments" >&2
exit 1
elif [[ "$cmd_run" ]] && [[ "$1" = -c ]]
then
shift
command="$command $*"
Expand Down

0 comments on commit 307d232

Please sign in to comment.