From c9fb988a577aa1bae779a0383f69ced6fcc92f8c Mon Sep 17 00:00:00 2001 From: jbteja Date: Sat, 23 May 2020 06:11:16 +0530 Subject: [PATCH] Tools: Added check for validating input arguments in ardupilot-astyle.sh --- Tools/CodeStyle/ardupilot-astyle.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Tools/CodeStyle/ardupilot-astyle.sh b/Tools/CodeStyle/ardupilot-astyle.sh index 61cda6e677..1f1ddbbcb2 100755 --- a/Tools/CodeStyle/ardupilot-astyle.sh +++ b/Tools/CodeStyle/ardupilot-astyle.sh @@ -1,4 +1,9 @@ -#!/bin/sh +#!/usr/bin/env bash + +if [ -z "$1" ]; then + printf "\nArguments missing, Usage: '$0 '\n\n" + exit 1 +fi if [ $(uname) = "Darwin" ]; then DIR=$(dirname $(greadlink -f $0)) @@ -7,4 +12,3 @@ else fi astyle --options="${DIR}"/astylerc $* -