Improve swift-init usage statement
Clarify the behavior of strict and non-strict options. Define what <server> and <config> specify on the command line. Drive-by fix for missing param in search_tree docstring. Change-Id: I89fff88a088bc73001464b1fa8240e14a61a117d
This commit is contained in:
2 changed files with 22 additions and 5 deletions
@@ -20,7 +20,21 @@ from optparse import OptionParser
from swift.common.manager import Manager, UnknownCommandError, \
KILL_WAIT, RUN_DIR
USAGE = """%prog <server>[.config] [<server>[.config] ...] <command> [options]
USAGE = \
"""%prog <server>[.<config>] [<server>[.<config>] ...] <command> [options]
where:
<server> is the name of a swift service e.g. proxy-server.
The '-server' part of the name may be omitted.
<config> is an explicit configuration filename without the
.conf extension. If <config> is specified then <server> should
refer to a directory containing the configuration file, e.g.:
swift-init object.1 start
will start an object-server using the configuration file
/etc/swift/object-server/1.conf
<command> is a command from the list below.
Commands:
""" + '\n'.join(["%16s: %s" % x for x in Manager.list_commands()])
@@ -53,13 +67,13 @@ def main():
# Changing behaviour if missing config
parser.add_option('--strict', dest='strict', action='store_true',
help="Return non-zero status code if some config is "
"missing. Default mode if server is explicitly "
"named.")
"missing. Default mode if all servers are "
"explicitly named.")
# a negative option for strict
parser.add_option('--non-strict', dest='strict', action='store_false',
help="Return zero status code even if some config is "
"missing. Default mode if server is one of aliases "
"`all`, `main` or `rest`.")
"missing. Default mode if any server is a glob or "
"one of aliases `all`, `main` or `rest`.")
options, args = parser.parse_args()
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.