aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2022-06-01 17:53:21 -0300
committerEuAndreh <eu@euandre.org>2022-06-01 17:53:21 -0300
commit85146b36d9fcf0e0bad828ea12e16b1aa7a1f05a (patch)
treeb80aada743308085bb5ec91b56c8d86cd7d01d71
parentbin/pb: Allow input to contain "```" without prior escaping (diff)
downloadeuandre.org-85146b36d9fcf0e0bad828ea12e16b1aa7a1f05a.tar.gz
euandre.org-85146b36d9fcf0e0bad828ea12e16b1aa7a1f05a.tar.xz
bin/article: Normalize usage() and help() text
-rwxr-xr-xbin/article39
1 files changed, 23 insertions, 16 deletions
diff --git a/bin/article b/bin/article
index 3c4b483..a6ce748 100755
--- a/bin/article
+++ b/bin/article
@@ -1,28 +1,35 @@
#!/bin/sh
set -eu
-# shellcheck source=/dev/null
-. "$DOTFILES/sh/colors.sh"
-
-missing() {
- red "Missing argument <${1}>.\n" >&2
+usage() {
+ cat <<-'EOF'
+ Usage:
+ article
+ article -h
+ EOF
}
-usage() {
- cat <<EOF >&2
-Usage:
- $0 <TYPE> <FULL_TITLE>
+help() {
+ cat <<-'EOF'
- Arguments:
- TYPE The type of the article: article, til, slides, podcast, screencast
- FULL_TITLE Full title of the post
-Examples:
- $0 til 'I just learned this'
- $0 article 'My example article title'
-EOF
+ Options:
+ -h, --help show this message
+
+
+ Examples:
+
+ FIXME:
+
+ $ FIXME
+ $0 til 'I just learned this'
+ $0 article 'My example article title'
+ EOF
}
+
+
+
TYPE="${1:-}"
[ -z "$TYPE" ] && {
missing 'TYPE'