diff -Nru ubuntu-vm-builder-0.4/debian/changelog ubuntu-vm-builder-0.4-0ubuntu0.1/debian/changelog --- ubuntu-vm-builder-0.4/debian/changelog 2008-04-28 18:28:55.000000000 +0300 +++ ubuntu-vm-builder-0.4-0ubuntu0.1/debian/changelog 2008-05-23 04:32:14.000000000 +0300 @@ -1,3 +1,12 @@ +ubuntu-vm-builder (0.4-0ubuntu0.1-sladen1) unpublished; urgency=low + + * Consolidate vm specific help messages to reduce --help output. + * Fetch program_name from '$0' instead of hard-coding. + * Remove double-negative in ip' help test. + * Remove "('*' denotes default option)" text as unused. + + -- Paul Sladen Fri, 23 May 2008 01:58:35 +0300 + ubuntu-vm-builder (0.4-0ubuntu0.1) hardy-security; urgency=low * SECURITY UPDATE: adjust ubuntu-vm-builder to lock root account by default diff -Nru /tmp/v7VkIzaI4x/ubuntu-vm-builder-0.4/ubuntu-vm-builder /tmp/8k1lUPOcV5/ubuntu-vm-builder-0.4-0ubuntu0.1/ubuntu-vm-builder --- ubuntu-vm-builder-0.4/ubuntu-vm-builder 2008-04-28 18:26:47.000000000 +0300 +++ ubuntu-vm-builder-0.4-0ubuntu0.1/ubuntu-vm-builder 2008-05-23 04:25:26.000000000 +0300 @@ -9,6 +9,7 @@ # Mike Frisch # Nick Barcet # Onno Benschop +# Paul Sladen # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -31,10 +32,10 @@ # Keep perl inside the chroot quiet LANG=C - +program_name="`basename \"$0\"`" usage () { cat < +usage: $program_name [--addpkg PKG] [(-a|--arch) [i386,amd64]] [(-d|--dest) ] @@ -63,15 +64,15 @@ [--gw address] [--dns address] ] -vm Generate image for the specified virtualisation software. + Generate image for the specified virtualisation software. Valid choices are: vmw6 vmserver vbox qemu kvm -suite Use the specified Ubuntu suite. + Use the specified Ubuntu suite. Valid options: hardy, gutsy, feisty, edgy, dapper --addpkg PKG Install PKG into the guest (can be specfied multiple times) -a, --arch ARCH Specify the target architecture. Valid options: i386 amd64 (defaults to host architecture) -d, --dest Specify the destination directory. - Default: ubuntu-vm-$SUITE-$ARCH + Default: 'ubuntu-vm-\$SUITE-\$ARCH' --domain DOMAIN Set DOMAIN as the domain name of the guest. Default: The domain of the machine running this script. -h, --help This help text. @@ -100,7 +101,7 @@ --- /var 2000 /log 1500 -The following three options are not used if --part is specified: +The following three options are not used if '--part' is specified: --rootsize size The size in MB of the root filesystem (default 4096) --optsize size The size in MB of the /opt filesystem. If not set, no /opt filesystem will be added. @@ -117,30 +118,45 @@ --ip address Ip address in dotted form (defaults to dhcp if not specified) -Options below are discarded if --ip is not specified +Options only available after specifying '--ip' first: --mask value IP mask in dotted form (default: 255.255.255.0) --net value IP net address (default: X.X.X.0) --bcast value IP broadcast (default: X.X.X.255) --gw address Gateway address (default: X.X.X.1) --dns address Name server address (default: X.X.X.1) -('*' denotes default option) - EOT - # # Emit usage info specific to each vm type - # - for vm in /usr/share/ubuntu-vm-builder/vms/* + # Go a little way further to consolidate usage information + declare -a t vm_helps vm_names + for vm_script in /usr/share/ubuntu-vm-builder/vms/*[^x] do - vm="`basename "$vm"`" - echo "Options specific for vm type $vm:" - /usr/share/ubuntu-vm-builder/vms/$vm usage + vm_name="`basename \"$vm_script\"`" + vm_specific_usage="`\"$vm_script\" usage`" + let i=0 + for vm_help in "${vm_helps[@]}"; do + if [ -n "$vm_specific_usage" -a "$vm_help" = "$vm_specific_usage" ] ; then + vm_names[$i]+=", $vm_name" + break + fi + let i+=1 + done + # no match, add a new entry + if (( "$i" >= ${#vm_helps[@]} )) ; then + vm_names+=("$vm_name") + vm_helps+=("$vm_specific_usage") + fi + done + # print the consolidated options + for (( i=0; i<${#vm_helps[@]}; i++)); do + echo "Options specific for" "${vm_names[$i]}": + echo "${vm_helps[$i]}" done cat <. EOT }