]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
ceph.in: reject -w/--watch flags when used with subcommands 69652/head
authorYonatan Zaken <yzaken@redhat.com>
Mon, 22 Jun 2026 17:02:39 +0000 (20:02 +0300)
committerYonatan Zaken <yzaken@redhat.com>
Mon, 22 Jun 2026 17:02:39 +0000 (20:02 +0300)
commit1651ec9a0f65d566b7677b539e3802fdeee15496
tree1d2ca339db4674a98a512ec971917e94fded0f93
parentc900556800a8ae7965e93d3f2091973de12c9225
ceph.in: reject -w/--watch flags when used with subcommands

parse_known_args() silently consumes -w and all --watch-* flags
before subcommand arguments reach the command validator. When a
user ran "ceph orch ps -w", the watch handler entered cluster log
streaming mode while discarding the subcommand entirely, with no
error or indication that the orch ps command was ignored.

Add a guard at the entry of the watch handler: if any watch flag
is active and childargs is non-empty, print "Invalid command:
unused arguments: [...]" and return EINVAL. This matches the
behaviour already seen when -s/--status is combined with a
subcommand.

Assisted-by: Claude:claude-4.6-sonnet
Fixes: https://tracker.ceph.com/issues/77121
Signed-off-by: Yonatan Zaken <yzaken@redhat.com>
src/ceph.in