aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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'