diff --git a/doc/manual_build.sh b/doc/manual_build.sh
index f62a06d7cb745d97800bb7abab074f13c869a5d6..0777a95ad18560d3dfd621aa9b413b84bdc5b04e 100755
--- a/doc/manual_build.sh
+++ b/doc/manual_build.sh
@@ -21,11 +21,11 @@ Optional
    -r     Specify the release version number of the manual(s) instead of the branch name
 EOF
                                  exit 0 ;;
-            ('p') x_p=0        ; shift  ;;
-            ('r') x_r=${OPTARG}; shift 2;;
+            ('p') x_p=0                 ;;
+            ('r') x_r=${OPTARG}         ;;
         esac
 done
-shift $(($OPTIND));
+shift $(( $OPTIND - 1 ));
 
 VER_NUM=${x_r}
 DRAFT=${x_p}