scripts/checksyscalls.sh: Add usage message, fix -Wno-error
PATCH 1/1 scripts/checksyscalls.sh: Add usage message, fix -Wno-error
From: Ritvik Gupta <[email protected]>
Currently 'scripts/checksyscalls.sh' does not provide guidance when executed without specifying a compiler, instead it attempts to execute '-Wno-error' parameter as a command, resulting in 'Wno-error: Command not found' error.
This patch adds a usage message that is displayed when no compiler is provided as parameter to improve clarity.
--- scripts/checksyscalls.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
scripts/checksyscalls.sh +15 -0
@@ -10,6 +10,21 @@ # checksyscalls.sh gcc gcc-options # +usage() { +cat <<EOF +Usage: $0 <compiler> [compiler-options] + +Example: + $0 gcc +EOF +exit 1 +} + +if [[ $# -eq 0 ]]; then + echo "Error: No compiler provided." + usage +fi + ignore_list() { cat << EOF #include <asm/types.h>
Signature · 1 line
2.48.1
Quoted 26 lines · ritvikfoss
From: Ritvik Gupta <[email protected]>
Currently '
scripts/checksyscalls.sh' does not provide guidance when executed without specifying a compiler, instead it attempts to execute '-Wno-error' parameter as a command, resulting in 'Wno-error: Command not found' error.This patch adds a usage message that is displayed when no compiler is provided as parameter to improve clarity.
Signed-off-by Ritvik Gupta <[email protected]>--- scripts/checksyscalls.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+)scripts/checksyscalls.sh +1
-0@@ -10,6 +10,21 @@ # checksyscalls.sh gcc gcc-options # +usage() {
scripts/checksyscalls.sh line 23
Quoted 10 lines
scripts/checksyscalls.sh +10
-0+cat <<EOF +Usage: $0 <compiler> [compiler-options] + +Example: + $0 gcc +EOF +exit 1 +} + +if [[ $# -eq 0 ]]; then
[[ is bash, while this script is POSIX #!/bin/sh
Quoted 7 lines
scripts/checksyscalls.sh +4
-0+ echo "Error: No compiler provided." + usage +fi + ignore_list() { cat << EOF #include <asm/types.h>
PATCH v2 1/1 scripts/checksyscalls.sh: Add usage message, fix -Wno-error
In reply to [email protected]From: Ritvik Gupta <[email protected]>
Currently 'scripts/checksyscalls.sh' does not provide guidance when executed without specifying a compiler, instead it attempts to execute '-Wno-error' parameter as a command, resulting in 'Wno-error: Command not found' error.
This patch adds a usage message that is displayed when no compiler is provided as parameter to improve clarity.
---
Changes in v2:
- Make the script posix compliant
- Fixed formatting
Thanks for reviewing!
scripts/checksyscalls.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
scripts/checksyscalls.sh +16 -0
@@ -10,6 +10,22 @@ # checksyscalls.sh gcc gcc-options # +usage() { +cat << EOF +Usage: $0 <compiler> [compiler-options] + +Example: + $0 gcc +EOF + +exit 1 +} + +if [ $# -eq 0 ]; then + echo "Error: No compiler provided." + usage +fi + ignore_list() { cat << EOF #include <asm/types.h>
Signature · 1 line
2.48.1