Skip to content

Commit

Permalink
Add program-created
Browse files Browse the repository at this point in the history
  • Loading branch information
joelparkerhenderson committed Mar 21, 2023
1 parent f652e96 commit cfb4d86
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 8 deletions.
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# License

MIT or Apache-2 or GPL-2.0 or GPL-3.0 or contact us for more
GPL-2.0 or GPL-3.0 or contact us for more
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ To use this program, you need to first do this:
* `--program-version`:
print the program version number

* `--program-created`:
print the program updated date

* `--program-updated`:
print the program updated date

Expand Down Expand Up @@ -96,7 +99,8 @@ Examples:

* Command: curl-chatgpt
* Version: 1.0.0
* Created: 2023-03-11T20:50:17Z
* Updated: 2023-03-13T05:55:35Z
* License: MIT or Apache-2 or GPL-2.0 or GPL-3.0 or contact us for more
* License: GPL-2.0 or GPL-3.0 or contact us for more
* Website: https://github.com/sixarm/curl-chatgpt
* Contact: Joel Parker Henderson (joel@sixarm.com)
21 changes: 15 additions & 6 deletions curl-chatgpt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ set -euf

program_command="curl-chatgpt"
program_version="1.0.0"
program_created="2023-03-11T20:50:17Z"
program_updated="2023-03-13T05:55:35Z"
program_license="MIT or Apache-2 or GPL-2.0 or GPL-3.0 or contact us for more"
program_license="GPL-2.0 or GPL-3.0 or contact us for more"
program_website="https://github.com/sixarm/curl-chatgpt"
program_contact="Joel Parker Henderson (joel@sixarm.com)"

Expand Down Expand Up @@ -83,6 +84,9 @@ To use this program, you need to first do this:
* --program-version:
print the program version number
* --program-created:
print the program created date
* --program-updated:
print the program updated date
Expand Down Expand Up @@ -111,6 +115,7 @@ Examples:
* Command: $program_command
* Version: $program_version
* Created: $program_updated
* Updated: $program_updated
* License: $program_license
* Website: $program_website
Expand All @@ -124,13 +129,13 @@ EOF
# https://github.com/sixarm/sixarm-unix-shell-functions
##

# Exit code: OK i.e the program run is a success.
EX_OK=0
# Exit SUCCESS i.e the program run worked correctly.
EXIT_SUCCESS=0

# Exit code: a service is unavailable. This can occur if a support program or
# file does not exist. This can also be used as a catchall message when
# something you wanted to do does not work, but you do not know why.
EX_UNAVAILABLE=69
EXIT_UNAVAILABLE=69

# out: print output message to stdout.
#
Expand Down Expand Up @@ -191,7 +196,7 @@ cmd() {
# => exit 1
# ```
cmd_or_die() {
cmd "$1" || die "$EX_UNAVAILABLE" "Command needed: $1"
cmd "$1" || die "$EXIT_UNAVAILABLE" "Command needed: $1"
}

##
Expand Down Expand Up @@ -302,6 +307,10 @@ while [ $# -gt 0 ]; do
shift
out "$program_version"
;;
--program-created)
shift
out "$program_created"
;;
--program-updated)
shift
out "$program_updated"
Expand All @@ -325,4 +334,4 @@ while [ $# -gt 0 ]; do
esac
done

exit $EX_OK
exit $EXIT_SUCCESS

0 comments on commit cfb4d86

Please sign in to comment.