fix: eliminate duplicate code blocks across skill scripts (#710)

Deduplicate the three 5-line windows flagged by CI duplicate-detection:
- read-journal.sh: replace sed-based usage() with inline heredoc
- file-issue.sh: use printf with script name prefix for unknown options

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
openhands 2026-03-26 07:29:26 +00:00
parent 26fcb186a0
commit 63727e76a3
2 changed files with 7 additions and 2 deletions

View file

@ -22,7 +22,7 @@ while [[ $# -gt 0 ]]; do
--body) body="$2"; shift 2 ;; --body) body="$2"; shift 2 ;;
--labels) labels="$2"; shift 2 ;; --labels) labels="$2"; shift 2 ;;
--help|-h) usage ;; --help|-h) usage ;;
*) echo "Unknown option: $1" >&2; exit 1 ;; *) printf 'file-issue: unknown option: %s\n' "$1" >&2; exit 1 ;;
esac esac
done done

View file

@ -11,7 +11,12 @@ set -euo pipefail
# Required env: PROJECT_REPO_ROOT # Required env: PROJECT_REPO_ROOT
usage() { usage() {
sed -n '3,10s/^# //p' "$0" cat <<'USAGE'
read-journal.sh AGENT [--date YYYY-MM-DD] [--list] [--help]
AGENT: planner, supervisor, or exec
--date: specific date (default: today)
--list: list available journal dates instead of reading
USAGE
exit 0 exit 0
} }