Commit 050148de authored by Patrick J Cherry's avatar Patrick J Cherry
Browse files

common: Fixed up --help output for commands

A bad pattern was copied all over the place, calling the wrong method.
The method has now been renamed (and an alias inserted for the old
name).
parent fab5debe
#!/usr/bin/ruby
#
# NAME
#
# is-bytemark-ip - Check if a system's IP addresses are on the Bytemark network.
#
# SYNOPSIS
#
# is-bytemark-ip [ --ipv4 | -4 ] [ --ipv6 | -6 ]
# [ --verbose | -v ] [ --help | -h ] [ <ip address> ]
#
# OPTIONS
#
# --ipv4 Check IPv4 addresses
#
# --ipv6 Check IPv6 addresses
......
#!/usr/bin/ruby -w
#
# NAME
#
# symbiosis-encrypt-password - encrypt a password
#
# SYNOPSIS
#
# symbiosis-encrypt-password [--help] [ --manual ] [--verbose] [--alogrithm a] [--marker m] password_or_password_file
#
# OPTIONS
#
# --algorithm a Specify which alogrithm to use. This is specified by ID.
# Defaults to 6, i.e. SHA-512
#
......
#!/usr/bin/ruby
#
# NAME
#
# symbiosis-ip - Determine the primary IP address of this system
#
# SYNOPSIS
#
# symbiosis-ip [ --all ] [ --ipv4 ] [ --ipv6 ] [ --verbose ] [ --help ]
#
# OPTIONS
#
# --all Show all available addresses on the system, not just the
# primary one.
#
......
#!/usr/bin/ruby
#
# NAME
#
# symbiosis-ssl - Manage and generate SSL certificates
#
# SYNOPSIS
#
# symbiosis-ssl [ --threshold N ] [ --no-generate ] [ --no-rollover ] [ --verbose ] [ --manual ]
# [ --help ] [ DOMAIN DOMAIN ...]
#
# OPTIONS
#
# --threshold N Number days before expiry that certificates should be renewed. Defaults to 10.
#
# --no-generate Do not try and generate keys or certificates.
......@@ -26,7 +23,6 @@
# --verbose Show debugging information.
#
# AUTHOR
#
# Patrick J. Cherry <patrick@bytemark.co.uk>
#
......
#!/usr/bin/ruby
#
# NAME
#
# symbiosis-test - Test systems' functionality running under Symbiosis
# symbiosis-test - Test systems' functionality running under Symbiosis
#
# SYNOPSIS
#
# symbiosis-test [ --help ] [ --manual ] [ --verbose ] [directory]
# symbiosis-test [ --help ] [ --manual ] [ --verbose ] [directory]
#
# OPTIONS
#
# --help Show a brief help message.
#
# --manual Show the full manual.
......
#!/usr/bin/ruby
#
# NAME
#
# which-backup-space - determine which backup space is to be used.
#
# SYNOPSIS
# which-backup-space [ --help ] [ --verbose ] [ --show-all ] [ --manual ]
#
# Help Options:
#
# OPTIONS
# --help Show the help information for this script.
# --verbose Show debugging information.
# --show-all Show all backup spaces for all IPs on the machine
# --manual Display the manpage
#
# This script just checks which backup space is allocated to an individual IP.
#
......
......@@ -16,7 +16,7 @@ module Symbiosis
# This method will show the manual to the caller.
#
def show_manual( filename )
show_help_or_usage( filename, false )
show_help_or_manual( filename, false )
end
#
......@@ -25,15 +25,16 @@ module Symbiosis
#
# This method will show brief usage-information to the caller.
#
def show_usage( filename )
show_help_or_usage( filename, true )
def show_help( filename )
show_help_or_manual( filename, true )
end
alias :show_usage :show_help
#
# Show either the manual, or the brief usage text.
#
def show_help_or_usage( filename, help )
def show_help_or_manual( filename, help )
#
# Open the file, stripping the shebang line
......@@ -504,7 +505,7 @@ module Symbiosis
raise Errno::ENOLCK, "Unable to release lock -- #{err.to_s}"
end
module_function :mkdir_p, :set_param, :get_param, :random_string, :safe_open, :parse_quota, :lock, :unlock, :show_usage, :show_manual, :show_help_or_usage
module_function :mkdir_p, :set_param, :get_param, :random_string, :safe_open, :parse_quota, :lock, :unlock, :show_help, :show_usage, :show_manual, :show_help_or_manual
end
......
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