diff --git a/p2v/virt-p2v-make-disk.in b/p2v/virt-p2v-make-disk.in index eeaa3b79a..c5b546354 100644 --- a/p2v/virt-p2v-make-disk.in +++ b/p2v/virt-p2v-make-disk.in @@ -36,9 +36,11 @@ else fi # Parse the command line arguments. +shortopts=o:vV +longopts=arch:,help,short-options,inject-ssh-identity:,install:,long-options,no-warn-if-partition,output:,verbose,version TEMP=`getopt \ - -o o:vV \ - --long arch:,help,inject-ssh-identity:,install:,no-warn-if-partition,output:,verbose,version \ + -o "$shortopts" \ + --long "$longopts" \ -n $program -- "$@"` if [ $? != 0 ]; then echo "$program: problem parsing the command line arguments" @@ -92,6 +94,15 @@ while true; do -V|--version) echo "$program $version" exit 0;; + --short-options) + echo -n "$shortopts" | + @SED@ -e 's/://g' -e 's/\(.\)/-\1\n/g' + exit 0;; + --long-options) + echo "$longopts" | + @SED@ -e 's/,/\n/g' -e 's/:$//mg' -e 's/\(.*\)/--\1/mg' | + grep -v -E -- "--(short|long)-options" + exit 0;; --) shift break;; diff --git a/p2v/virt-p2v-make-kickstart.in b/p2v/virt-p2v-make-kickstart.in index c57e212aa..85217d5b1 100644 --- a/p2v/virt-p2v-make-kickstart.in +++ b/p2v/virt-p2v-make-kickstart.in @@ -22,9 +22,12 @@ unset CDPATH program="virt-p2v-make-kickstart" version="@PACKAGE_VERSION@" +# Parse the command line arguments. +shortopts=o:vV +longopts=help,inject-ssh-identity:,install:,long-options,output:,proxy:,short-options,verbose,version TEMP=`getopt \ - -o o:vV \ - --long help,inject-ssh-identity:,install:,output:,proxy:,verbose,version \ + -o "$shortopts" \ + --long "$longopts" \ -n $program -- "$@"` if [ $? != 0 ]; then echo "$program: problem parsing the command line arguments" @@ -68,11 +71,22 @@ while true; do set +x verbose=1 shift;; + + # help etc. + --help) + usage 0;; -V|--version) echo "$program $version" exit 0;; - --help) - usage 0;; + --short-options) + echo -n "$shortopts" | + @SED@ -e 's/://g' -e 's/\(.\)/-\1\n/g' + exit 0;; + --long-options) + echo "$longopts" | + @SED@ -e 's/,/\n/g' -e 's/:$//mg' -e 's/\(.*\)/--\1/mg' | + grep -v -E -- "--(short|long)-options" + exit 0;; --) shift break;; diff --git a/p2v/virt-p2v-make-kiwi.in b/p2v/virt-p2v-make-kiwi.in index e493bd4b0..dc7fce45b 100644 --- a/p2v/virt-p2v-make-kiwi.in +++ b/p2v/virt-p2v-make-kiwi.in @@ -22,9 +22,12 @@ unset CDPATH program="virt-p2v-make-kiwi" version="@PACKAGE_VERSION@" +# Parse the command line arguments. +shortopts=o:V +longopts=help,inject-ssh-identity:,long-options,output:,short-options,version TEMP=`getopt \ - -o o:V \ - --long help,inject-ssh-identity:,output:,version \ + -o "$shortopts" \ + --long "$longopts" \ -n $program -- "$@"` if [ $? != 0 ]; then echo "$program: problem parsing the command line arguments" @@ -52,11 +55,22 @@ while true; do -o|--output) output="$2" shift 2;; + + # help etc. + --help) + usage 0;; -V|--version) echo "$program $version" exit 0;; - --help) - usage 0;; + --short-options) + echo -n "$shortopts" | + @SED@ -e 's/://g' -e 's/\(.\)/-\1\n/g' + exit 0;; + --long-options) + echo "$longopts" | + @SED@ -e 's/,/\n/g' -e 's/:$//mg' -e 's/\(.*\)/--\1/mg' | + grep -v -E -- "--(short|long)-options" + exit 0;; --) shift break;;