Commit 9eb10d67 authored by Paul John King's avatar Paul John King

Added help options, and documented the -m and -i options --

parent 29a2c8f5
......@@ -14,16 +14,23 @@ print_usage_message(){
echo_stdin <<- __END_OF_STDIN__
Usages:
${0##*/} help
${0##*/} create pool <name> <path>
${0##*/} destroy pool <name>
${0##*/} create|destroy pool help
${0##*/} create volume <name> <pool> <path>
${0##*/} destroy volume <name> <pool>
${0##*/} create domain <name> <cpu_count> <ram> <path> <bridge>
${0##*/} create|destroy volume help
${0##*/} create domain [-m <mac_address>] <name> <cpu_count> <ram> <path> <bridge>
${0##*/} destroy domain <name>
${0##*/} create machine <name> <cpu_count> <ram> <path> <bridge>
${0##*/} create|destroy domain help
${0##*/} create machine [-i ipv4_address] <name> <cpu_count> <ram> <path> <bridge>
${0##*/} destroy machine <name>
${0##*/} create|destroy machine help
${0##*/} get image path <volume> <pool>
${0##*/} get image path help
${0##*/} get mac address <ipv4_address>
${0##*/} get mac address help
__END_OF_STDIN__
} ;
......@@ -162,11 +169,12 @@ print_domain_usage_message(){
echo_stdin <<- __END_OF_STDIN__
The command call
${0##*/} create domain <name> <cpu_count> <ram> <path> <bridge>
${0##*/} create domain [-m <mac_address>] <name> <cpu_count> <ram> <path> <bridge>
creates a KVM domain with name <name>, <cpu_count> CPUs, <ram> MiB of RAM, the
file-system image at the path <path>, and a connection to the bridge device
<bridge>.
<bridge>. If the '-m' option is used then the domain has MAC address
<mac_address>.
The command call
......@@ -279,12 +287,21 @@ print_machine_usage_message(){
echo_stdin <<- __END_OF_STDIN__
The command call
${0##*/} create machine <name> <cpu_count> <ram> <path> <bridge>
${0##*/} create machine [-i <ipv4_address] <name> <cpu_count> <ram> <path> <bridge>
creates a KVM domain with name <name>, <cpu_count> CPUs, <ram> MiB of RAM, a
qcow2 storage volume with name <name> in the 'default' storage pool with the
qcow2 file-system image at the path <path> as its backing storage volume, and a
connection to the bridge device <bridge>.
connection to the bridge device <bridge>. If the '-i' option is given then the
domain has the MAC address output by
${0##*/} get mac address <ipv4_address>
Run
${0##*/} get mac address help
for details of this MAC address.
The command call
......@@ -519,6 +536,58 @@ get_mac_address(){
}
case "${1} ${2} ${3} ${4}" in
"get image path help"|"destroy pool help")
shift 3 ;
print_get_image_path_usage_message ;
exit 0 ;
;;
"get mac address help"|"destroy pool help")
shift 3 ;
print_get_mac_address_usage_message ;
exit 0 ;
;;
esac ;
case "${1} ${2} ${3}" in
"create pool help"|"destroy pool help")
shift 3 ;
print_pool_usage_message ;
exit 0 ;
;;
"create volume help"|"destroy volume help")
shift 3 ;
print_volume_usage_message ;
exit 0 ;
;;
"create domain help"|"destroy domain help")
shift 3 ;
print_domain_usage_message ;
exit 0 ;
;;
"create machine help"|"destroy machine help")
shift 3 ;
print_machine_usage_message ;
exit 0 ;
;;
"get image path")
shift 3 ;
get_image_path "${@}" ;
exit $? ;
;;
"get mac address")
shift 3 ;
get_mac_address "${@}" ;
exit $? ;
;;
esac ;
case "${1} ${2}" in
"create pool")
shift 2 ;
......@@ -569,18 +638,11 @@ case "${1} ${2}" in
;;
esac ;
case "${1} ${2} ${3}" in
"get image path")
shift 3 ;
get_image_path "${@}" ;
exit $? ;
;;
"get mac address")
shift 3 ;
get_mac_address "${@}" ;
exit $? ;
;;
case "${1}" in
"help")
shift 1 ;
print_usage_message ;
exit 0 ;
esac ;
print_usage_message ;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment