Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion c
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,28 @@ if ! [[ "$C_CACHE_SIZE" =~ ^[0-9]*$ ]]; then
fi

help_msg() {
>&$1 echo "Usage: $(basename "$0") <file.c ... | compiler_options ...> [program_arguments]"
>&$1 echo "Usage:"
>&$1 echo " $(basename "$0") '<file.c ... | compiler_options ...>' [program_arguments]"
>&$1 echo " $(basename "$0") --clear-cache"
>&$1 echo
>&$1 echo "Usage for shebang with extra compiler options:"
>&$1 echo " $(basename "$0") '<other.c ... | compiler_options ...> --' <file.c> [program_arguments]"
>&$1 echo
>&$1 echo 'Execute C programs from the command line.'
>&$1 echo
>&$1 echo ' Ex: c main.c'
>&$1 echo ' Ex: c main.c arg1 arg2'
>&$1 echo " Ex: c 'main.c other.c' arg1 arg2"
>&$1 echo " Ex: c 'main.c -lncurses' arg1 arg2"
>&$1 echo
>&$1 echo 'Execute C programs when "main.c" is executable with shebang.'
>&$1 echo
>&$1 echo ' Shebang: #!/usr/bin/env c'
>&$1 echo " Shebang: #!/usr/bin/env -S c 'other.c --'"
>&$1 echo " Shebang: #!/usr/bin/env -S c '-lncurses --'"
>&$1 echo ' Ex: ./main.c'
>&$1 echo ' Ex: ./main.c arg1 arg2'
>&$1 echo
}

cleanup() {
Expand Down