Skip to content

Commit

Permalink
Add version info
Browse files Browse the repository at this point in the history
Also remove redundant DATEH_DEFAULT_FORMAT setting
  • Loading branch information
Adrian Ho committed Jan 27, 2019
1 parent 079ea8e commit 55cfcb8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ Copy `dateh` to a directory in your `PATH`.
`dateh` takes the same options and format specifiers as GNU `date`, in addition to:
* `-h|--help` to print `dateh`-specific help
* `-H|--longhelp` to print both `dateh` and `date` help
* `-V|--version` to print `dateh` version

If the `DATEH_DEFAULT_FORMAT` environment variable is set, `dateh` uses its value as the fallback date representation for the `@{d+}` specifier (default: `%Y-%m-%d`).

Expand Down
3 changes: 2 additions & 1 deletion dateh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
DATEH_DEFAULT_FORMAT="${DATEH_DEFAULT_FORMAT:-%Y-%m-%d}"
VERSION=1.0
short_ordinals=(invalid 1st 2nd 3rd 4th 5th 6th 7th 8th 9th 10th 11th
12th 13th 14th 15th 16th 17th 18th 19th 20th 21st 22nd 23rd 24th 25th
26th 27th 28th 29th 30th 31st)
Expand Down Expand Up @@ -142,6 +142,7 @@ while true; do
case "$1" in
-h|--help) usage;;
-H|--longhelp) usage long;;
-V|--version) echo "dateh ${VERSION}"; exit 0;;
*) break;;
esac
shift
Expand Down

0 comments on commit 55cfcb8

Please sign in to comment.