Add --version/-V command line option
[mapsector.git] / mapsector
index a704e11..d3c2a72 100755 (executable)
--- a/mapsector
+++ b/mapsector
@@ -67,7 +67,7 @@ load "$libdir"
 
 #### Parse command line arguments
 
-X=`getopt -o "h" --long "help,noscan" -n "$name" -- "$@"`
+X=`getopt -o "hV" --long "help,noscan,version" -n "$name" -- "$@"`
 if [ $? != 0 ]; then exit 1; fi
 eval set -- "$X"
 
@@ -78,6 +78,7 @@ while true; do
     case "$1" in
        -h|--help) help="0"; shift ;;
        --noscan) noscan="0"; shift ;;
+       -V|--version) echo "$name $version"; exit 0 ;;
        --) shift; break ;;
        *) echo "! internal error"; exit 1 ;;
     esac