Skip to content

Commit

Permalink
feat(gh-edit): add version and flag to show it
Browse files Browse the repository at this point in the history
  • Loading branch information
nobe4 committed Nov 30, 2023
1 parent 6728e44 commit 74df748
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion gh-edit
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env bash
#VERSION 0.0.0
#/ Usage: gh-edit [FLAGS] [URL [FILE]]
#/
#/ Edit Issues, PRs, Comments and Gists locally
Expand All @@ -8,7 +9,8 @@
#/ - gh
#/
#/ Flags:
#/ -h Show this help
#/ -h Show this help
#/ -v Show the version
#/
#/ Arguments:
#/ FILE Path to local file to use.
Expand Down Expand Up @@ -40,6 +42,9 @@ set -e
show_help() { grep ^#/ <"${0}" | cut -c4-; }
[[ "$*" == "-h" ]] && show_help && exit 0

show_version() { grep ^#VERSION <"${0}" | cut -d' ' -f2; }
[[ "$*" == "-v" ]] && show_version && exit 0

input="${1}"

if [[ "${input}" == "" ]]; then
Expand Down

0 comments on commit 74df748

Please sign in to comment.