Skip to content

Commit

Permalink
feat: add --version flag
Browse files Browse the repository at this point in the history
  • Loading branch information
jahed committed Aug 13, 2020
1 parent 11ff17e commit 1bc4145
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ DESCRIPTION
Converts an image to map tiles to be used in Google Maps, Leaflet and other
map rendering software.
For more information, visit: https://github.com/jahed/im-map-tiles
Version: v1.0.0
Homepage: https://github.com/jahed/im-map-tiles
Donate: https://jahed.dev/donate
OPTIONS
<input_image>
Expand Down Expand Up @@ -53,6 +55,9 @@ OPTIONS
-h, --help
Prints this help message.
--version
Prints the version.
OUTPUT
Tiles in the <output_directory> will take the format of:
<output_directory>/{zoom_level}/tile_{x}_{y}.<format>
Expand Down
13 changes: 12 additions & 1 deletion im-map-tiles.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

version="v1.0.0"

function print_help {
cat <<EOF
NAME
Expand All @@ -12,7 +14,9 @@ DESCRIPTION
Converts an image to map tiles to be used in Google Maps, Leaflet and other
map rendering software.
For more information, visit: https://github.com/jahed/im-map-tiles
Version: ${version}
Homepage: https://github.com/jahed/im-map-tiles
Donate: https://jahed.dev/donate
OPTIONS
<input_image>
Expand Down Expand Up @@ -44,6 +48,9 @@ OPTIONS
-h, --help
Prints this help message.
--version
Prints the version.
OUTPUT
Tiles in the <output_directory> will take the format of:
<output_directory>/{zoom_level}/tile_{x}_{y}.<format>
Expand Down Expand Up @@ -102,6 +109,10 @@ while [[ $# -gt 0 ]]; do
print_help
exit 0
;;
--version)
echo "im-map-tiles ${version}"
exit 0
;;
-f|--format)
format="$2"
shift
Expand Down

0 comments on commit 1bc4145

Please sign in to comment.