Skip to content

Commit

Permalink
Correct help message and validation for required parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
guidomodarelli committed Feb 18, 2025
1 parent 63b8ba4 commit cd70a9e
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions dev-tools/build-packages/build-packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -166,15 +166,14 @@ help() {
echo " -a, --app <url/path> Set the location of the .zip file containing the Wazuh plugin."
echo " -b, --base <url/path> Set the location of the .tar.gz file containing the base wazuh-dashboard build."
echo " -s, --security <url/path> Set the location of the .zip file containing the wazuh-security-dashboards-plugin."
echo " -v, --version <version> Set the version of this build."
echo " --all-platforms Build for all platforms."
echo " --deb Build for deb."
echo " --rpm Build for rpm."
echo " --tar Build for tar."
echo " --production [Optional] The naming of the package will be ready for production."
echo " --arm [Optional] Build for arm64 instead of x64."
echo " --debug [Optional] Debug mode."
echo " --silent [Optional] Silent mode. Will not work if --debug is set."
echo " --production [Optional] The naming of the package will be ready for production."
echo " --arm [Optional] Build for arm64 instead of x64."
echo " --debug [Optional] Debug mode."
echo " --silent [Optional] Silent mode. Will not work if --debug is set."
echo " -r, --revision <revision> [Optional] Set the revision of this build. By default, it is set to 1."
echo " -h, --help Show this help."
echo
Expand Down Expand Up @@ -267,15 +266,15 @@ main() {
fi
;;
*)
echo "help"

echo "Unknown option: ${1}"
echo
help 1
;;
esac
done

if [ -z "$app" ] | [ -z "$base" ] | [ -z "$security" ] | [ -z "$version" ]; then
echo "You must specify the app, base, security and version."
if [ -z "$app" ] || [ -z "$base" ] || [ -z "$security" ]; then
echo "You must specify the app, base and security."
help 1
fi

Expand Down

0 comments on commit cd70a9e

Please sign in to comment.