mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-21 14:50:08 +03:00
changed cli help to be compatible with ronn formating (man pages)
This commit is contained in:
parent
a35d52fc02
commit
efa6f18680
@ -72,7 +72,11 @@ module CommandParser
|
||||
end
|
||||
|
||||
def usage(str)
|
||||
@usage = "Usage: #{str}"
|
||||
@usage=<<EOT
|
||||
## SYNOPSIS
|
||||
|
||||
#{str}
|
||||
EOT
|
||||
end
|
||||
|
||||
def version(str)
|
||||
@ -185,7 +189,7 @@ module CommandParser
|
||||
print_formatters
|
||||
puts
|
||||
if @version
|
||||
puts "== LICENSE"
|
||||
puts "## LICENSE"
|
||||
puts @version
|
||||
end
|
||||
end
|
||||
@ -193,7 +197,7 @@ module CommandParser
|
||||
private
|
||||
|
||||
def print_options
|
||||
puts "== Options"
|
||||
puts "## OPTIONS"
|
||||
|
||||
shown_opts = Array.new
|
||||
opt_format = "#{' '*5}%-25s %s"
|
||||
@ -217,7 +221,7 @@ module CommandParser
|
||||
end
|
||||
|
||||
def print_commands
|
||||
puts "== Commands"
|
||||
puts "## COMMANDS"
|
||||
|
||||
cmd_format5 = "#{' '*3}%s"
|
||||
cmd_format10 = "#{' '*8}%s"
|
||||
@ -243,7 +247,7 @@ module CommandParser
|
||||
opts_str=value[:options].flatten.collect{|o|
|
||||
o[:name]
|
||||
}.join(', ')
|
||||
printf cmd_format10, "options: #{opts_str}"
|
||||
printf cmd_format10, "valid options: #{opts_str}"
|
||||
puts
|
||||
end
|
||||
puts
|
||||
@ -251,7 +255,7 @@ module CommandParser
|
||||
end
|
||||
|
||||
def print_formatters
|
||||
puts "== Argument formats"
|
||||
puts "## ARGUMENT FORMATS"
|
||||
|
||||
cmd_format5 = "#{' '*3}%s"
|
||||
cmd_format10 = "#{' '*8}%s"
|
||||
|
@ -31,7 +31,7 @@ require 'command_parser'
|
||||
require 'one_helper/oneacl_helper'
|
||||
|
||||
cmd = CommandParser::CmdParser.new(ARGV) do
|
||||
usage "oneacl COMMAND [args..] [options..]"
|
||||
usage "`oneacl` <command> [<args>] [<options>]"
|
||||
version OpenNebulaHelper::ONE_VERSION
|
||||
|
||||
helper = OneAclHelper.new
|
||||
|
@ -31,7 +31,7 @@ require 'command_parser'
|
||||
require 'one_helper/onegroup_helper'
|
||||
|
||||
cmd=CommandParser::CmdParser.new(ARGV) do
|
||||
usage "onegroup COMMAND [args..] [options..]"
|
||||
usage "`onegroup` <command> [<args>] [<options>]"
|
||||
version OpenNebulaHelper::ONE_VERSION
|
||||
|
||||
helper = OneGroupHelper.new
|
||||
|
@ -31,7 +31,7 @@ require 'command_parser'
|
||||
require 'one_helper/onehost_helper'
|
||||
|
||||
cmd=CommandParser::CmdParser.new(ARGV) do
|
||||
usage "onehost COMMAND [args..] [options..]"
|
||||
usage "`onehost` <command> [<args>] [<options>]"
|
||||
version OpenNebulaHelper::ONE_VERSION
|
||||
|
||||
helper = OneHostHelper.new
|
||||
|
@ -31,7 +31,7 @@ require 'command_parser'
|
||||
require 'one_helper/oneimage_helper'
|
||||
|
||||
cmd=CommandParser::CmdParser.new(ARGV) do
|
||||
usage "oneimage COMMAND [args..] [options..]"
|
||||
usage "`oneimage` <command> [<args>] [<options>]"
|
||||
version OpenNebulaHelper::ONE_VERSION
|
||||
|
||||
helper = OneImageHelper.new
|
||||
|
@ -31,7 +31,7 @@ require 'command_parser'
|
||||
require 'one_helper/onetemplate_helper'
|
||||
|
||||
cmd=CommandParser::CmdParser.new(ARGV) do
|
||||
usage "onetemplate COMMAND [args..] [options..]"
|
||||
usage "`onetemplate` <command> [<args>] [<options>]"
|
||||
version OpenNebulaHelper::ONE_VERSION
|
||||
|
||||
helper = OneTemplateHelper.new
|
||||
|
@ -31,7 +31,7 @@ require 'command_parser'
|
||||
require 'one_helper/oneuser_helper'
|
||||
|
||||
cmd=CommandParser::CmdParser.new(ARGV) do
|
||||
usage "oneuser COMMAND [args..] [options..]"
|
||||
usage "`oneuser` <command> [<args>] [<options>]"
|
||||
version OpenNebulaHelper::ONE_VERSION
|
||||
|
||||
helper = OneUserHelper.new
|
||||
|
@ -31,7 +31,7 @@ require 'command_parser'
|
||||
require 'one_helper/onevm_helper'
|
||||
|
||||
cmd=CommandParser::CmdParser.new(ARGV) do
|
||||
usage "onevm COMMAND [args..] [options..]"
|
||||
usage "`onevm` <command> [<args>] [<options>]"
|
||||
version OpenNebulaHelper::ONE_VERSION
|
||||
|
||||
helper = OneVMHelper.new
|
||||
|
@ -31,7 +31,7 @@ require 'command_parser'
|
||||
require 'one_helper/onevnet_helper'
|
||||
|
||||
cmd=CommandParser::CmdParser.new(ARGV) do
|
||||
usage "onevnet COMMAND [args..] [options..]"
|
||||
usage "`onevnet` <command> [<args>] [<options>]"
|
||||
version OpenNebulaHelper::ONE_VERSION
|
||||
|
||||
helper = OneVNetHelper.new
|
||||
|
Loading…
x
Reference in New Issue
Block a user