Skip to content

Commit

Permalink
added helper for, e.g., "check 50"
Browse files Browse the repository at this point in the history
  • Loading branch information
dmalan committed Jul 3, 2024
1 parent 52bce67 commit 1fdf4a5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions opt/cs50/lib/help50/bash
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ if [[ "$output" =~ $regex ]]; then
exit
fi

# If CS50 command
if [[ "${BASH_REMATCH[1]}" =~ ^(check|style|submit)$ && "$2" == "50" ]]; then
echo "Did you mean to run \`${BASH_REMATCH[1]}50\`, without a space, instead?"
exit
fi

# If backslash instead of forward slash
if [[ "${BASH_REMATCH[1]}" =~ ^\.(.*) ]]; then
if [[ -f "./${BASH_REMATCH[1]}" ]]; then
Expand Down

0 comments on commit 1fdf4a5

Please sign in to comment.