1
0
mirror of https://github.com/OpenNebula/one.git synced 2024-12-22 13:33:52 +03:00

Added --version to cloud CLI

This commit is contained in:
Javi Fontan 2010-10-19 15:41:44 +02:00
parent 42bccd523d
commit 244a408bec
10 changed files with 47 additions and 0 deletions

View File

@ -135,4 +135,15 @@ module CloudCLI
def cmd_name
File.basename($0)
end
def version_text
version=<<EOT
OpenNebula 2.0.0
Copyright 2002-2010, OpenNebula Project Leads (OpenNebula.org)
Licensed under the Apache License, Version 2.0 (the "License"); you may
not use this file except in compliance with the License. You may obtain
a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
EOT
end
end

View File

@ -65,6 +65,7 @@ include CloudCLI
opts = GetoptLong.new(
['--help', '-h',GetoptLong::NO_ARGUMENT],
['--version', '-v',GetoptLong::NO_ARGUMENT],
['--access-key', '-K',GetoptLong::REQUIRED_ARGUMENT],
['--secret-key', '-S',GetoptLong::REQUIRED_ARGUMENT],
['--url', '-U',GetoptLong::REQUIRED_ARGUMENT],
@ -83,6 +84,9 @@ begin
when '--help'
puts COMMANDS_HELP
return
when '--version'
puts CloudCLI.version_text
exit 0
when '--access-key'
access = arg
when '--secret-key'

View File

@ -62,6 +62,7 @@ include CloudCLI
opts = GetoptLong.new(
['--help', '-h',GetoptLong::NO_ARGUMENT],
['--version', '-v',GetoptLong::NO_ARGUMENT],
['--access-key', '-K',GetoptLong::REQUIRED_ARGUMENT],
['--secret-key', '-S',GetoptLong::REQUIRED_ARGUMENT],
['--url', '-U',GetoptLong::REQUIRED_ARGUMENT],
@ -80,6 +81,9 @@ begin
when '--help'
puts COMMANDS_HELP
return
when '--version'
puts CloudCLI.version_text
exit 0
when '--access-key'
access = arg
when '--secret-key'

View File

@ -66,6 +66,7 @@ include CloudCLI
opts = GetoptLong.new(
['--help', '-h',GetoptLong::NO_ARGUMENT],
['--version', '-v',GetoptLong::NO_ARGUMENT],
['--access-key', '-K',GetoptLong::REQUIRED_ARGUMENT],
['--secret-key', '-S',GetoptLong::REQUIRED_ARGUMENT],
['--url', '-U',GetoptLong::REQUIRED_ARGUMENT],
@ -84,6 +85,9 @@ begin
when '--help'
puts COMMANDS_HELP
return
when '--version'
puts CloudCLI.version_text
exit 0
when '--access-key'
access = arg
when '--secret-key'

View File

@ -73,6 +73,7 @@ include CloudCLI
opts = GetoptLong.new(
['--help', '-h',GetoptLong::NO_ARGUMENT],
['--version', '-v',GetoptLong::NO_ARGUMENT],
['--access-key', '-K',GetoptLong::REQUIRED_ARGUMENT],
['--secret-key', '-S',GetoptLong::REQUIRED_ARGUMENT],
['--url', '-U',GetoptLong::REQUIRED_ARGUMENT],
@ -95,6 +96,9 @@ begin
when '--help'
puts COMMANDS_HELP
return
when '--version'
puts CloudCLI.version_text
exit 0
when '--access-key'
access = arg
when '--secret-key'

View File

@ -63,6 +63,7 @@ include CloudCLI
opts = GetoptLong.new(
['--help', '-h',GetoptLong::NO_ARGUMENT],
['--version', '-v',GetoptLong::NO_ARGUMENT],
['--access-key', '-K',GetoptLong::REQUIRED_ARGUMENT],
['--secret-key', '-S',GetoptLong::REQUIRED_ARGUMENT],
['--url', '-U',GetoptLong::REQUIRED_ARGUMENT]
@ -79,6 +80,9 @@ begin
when '--help'
puts COMMANDS_HELP
return
when '--version'
puts CloudCLI.version_text
exit 0
when '--access-key'
access = arg
when '--secret-key'

View File

@ -65,6 +65,7 @@ include CloudCLI
opts = GetoptLong.new(
['--help', '-h',GetoptLong::NO_ARGUMENT],
['--version', '-v',GetoptLong::NO_ARGUMENT],
['--access-key', '-K',GetoptLong::REQUIRED_ARGUMENT],
['--secret-key', '-S',GetoptLong::REQUIRED_ARGUMENT],
['--url', '-U',GetoptLong::REQUIRED_ARGUMENT],
@ -83,6 +84,9 @@ begin
when '--help'
puts COMMANDS_HELP
return
when '--version'
puts CloudCLI.version_text
exit 0
when '--access-key'
access = arg
when '--secret-key'

View File

@ -88,6 +88,7 @@ include CloudCLI
opts = GetoptLong.new(
['--help', '-h',GetoptLong::NO_ARGUMENT],
['--version', '-v',GetoptLong::NO_ARGUMENT],
['--username', '-U',GetoptLong::REQUIRED_ARGUMENT],
['--password', '-P',GetoptLong::REQUIRED_ARGUMENT],
['--url', '-R',GetoptLong::REQUIRED_ARGUMENT],
@ -108,6 +109,9 @@ begin
when '--help'
puts COMMANDS_HELP
return
when '--version'
puts CloudCLI.version_text
exit 0
when '--username'
username = arg
when '--password'

View File

@ -89,6 +89,7 @@ include CloudCLI
opts = GetoptLong.new(
['--help', '-h',GetoptLong::NO_ARGUMENT],
['--version', '-v',GetoptLong::NO_ARGUMENT],
['--username', '-U',GetoptLong::REQUIRED_ARGUMENT],
['--password', '-P',GetoptLong::REQUIRED_ARGUMENT],
['--url', '-R',GetoptLong::REQUIRED_ARGUMENT],
@ -109,6 +110,9 @@ begin
when '--help'
puts COMMANDS_HELP
return
when '--version'
puts CloudCLI.version_text
exit 0
when '--username'
username = arg
when '--password'

View File

@ -87,6 +87,7 @@ include CloudCLI
opts = GetoptLong.new(
['--help', '-h',GetoptLong::NO_ARGUMENT],
['--version', '-v',GetoptLong::NO_ARGUMENT],
['--username', '-U',GetoptLong::REQUIRED_ARGUMENT],
['--password', '-P',GetoptLong::REQUIRED_ARGUMENT],
['--url', '-R',GetoptLong::REQUIRED_ARGUMENT],
@ -109,6 +110,9 @@ begin
when '--help'
puts COMMANDS_HELP
return
when '--version'
puts CloudCLI.version_text
exit 0
when '--username'
username = arg
when '--password'