From 48691b582ba7ccbd5ab72b1a81d5d307f0c4e311 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 25 Feb 2020 16:34:53 -0600 Subject: [PATCH] ceph: -W as shorthand for --watch-channel 'ceph -w' to watch default cluster channel 'ceph -W foo' to watch channel 'foo' Signed-off-by: Sage Weil --- doc/man/8/ceph.rst | 6 +++++- src/ceph.in | 13 +++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/doc/man/8/ceph.rst b/doc/man/8/ceph.rst index 7c98629637f01..4cdbd737a3603 100644 --- a/doc/man/8/ceph.rst +++ b/doc/man/8/ceph.rst @@ -1575,7 +1575,11 @@ Options .. option:: -w, --watch - Watch live cluster changes. + Watch live cluster changes on the default 'cluster' channel + +.. option:: -W, --watch-channel + + Watch live cluster changes on any channel (cluster, audit, cephadm, or * for all) .. option:: --watch-debug diff --git a/src/ceph.in b/src/ceph.in index 014e49166a6f8..34b6c468b73ea 100755 --- a/src/ceph.in +++ b/src/ceph.in @@ -323,10 +323,9 @@ def parse_cmdargs(args=None, target=''): parser.add_argument('--watch-error', action='store_true', help='watch error events') - parser.add_argument('--watch-channel', dest="watch_channel", - help="log channel to follow " \ - "when using -w/--watch; '*' for all", - default='cluster') + parser.add_argument('-W', '--watch-channel', dest="watch_channel", + help="watch live cluster changes on a specific channel " + "(e.g., cluster, audit, cephadm, or '*' for all)") parser.add_argument('--version', '-v', action="store_true", help="display version") parser.add_argument('--verbose', action="store_true", help="make verbose") @@ -914,6 +913,12 @@ def main(): CEPH_RELEASE_TYPE)) # noqa return 0 + # --watch-channel|-W implies -w + if parsed_args.watch_channel: + parsed_args.watch = True + elif parsed_args.watch and not parsed_args.watch_channel: + parsed_args.watch_channel = 'cluster' + global verbose verbose = parsed_args.verbose -- 2.39.5