Skip to content
Open
Show file tree
Hide file tree
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
13 changes: 13 additions & 0 deletions ada
Original file line number Diff line number Diff line change
Expand Up @@ -694,6 +694,7 @@ usage() {
${GREEN}ada enable${RST} <name> Enable a service
${GREEN}ada disable${RST} <name> Disable a service
${GREEN}ada watch${RST} Start supervisor loop (foreground)
${GREEN}ada dashboard${RST} [-p PORT] Launch web dashboard (default: 7070)

${BOLD}EXAMPLES${RST}
ada start all Start all enabled services
Expand Down Expand Up @@ -800,6 +801,18 @@ case "${cmd}" in
do_watch
;;

dashboard|dash|d)
port=7070
while [[ $# -gt 0 ]]; do
case "$1" in
-p|--port) port="$2"; shift 2 ;;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Validate dashboard port flag before consuming argument

The dashboard option parser reads port="$2" unconditionally for -p/--port; running ada dashboard -p without a value triggers set -u's unbound-variable error instead of a controlled CLI error message. This creates a user-facing failure path for a common argument mistake and bypasses the script’s normal die-based usage handling.

Useful? React with 👍 / 👎.

*) die "unknown option: $1 (try: ada dashboard -p 8080)" ;;
esac
done
info "starting dashboard on ${BOLD}http://0.0.0.0:${port}${RST}"
exec python3 "${SCRIPT_DIR}/ada-dashboard.py" "${port}"
;;

version|--version|-v)
printf 'ada v%s\n' "${ADA_VERSION}"
;;
Expand Down
Loading