feat(xce-test-cli-ux): migrate all flag-accepting commands to flagspec

Migrates 17 commands (cmd_hello, cmd_jobinfo, cmd_jobrun, cmd_jobsub,
cmd_resval, cmd_jobkill, cmd_jobckpt, cmd_qctrl, cmd_hostctrl,
cmd_runtasks, cmd_setpend, cmd_jobstart, cmd_jobfinish, cmd_jobfail,
cmd_resupdate, cmd_walcompare, join_worker_parse_attrs) from raw
getopt()/hand-rolled parsing to the shared flagspec_t + getopt_long
mechanism, so every one now uniformly rejects an unrecognized or
malformed flag with a usage summary and, where a close match exists,
a suggestion. cmd_walcompare's hand-rolled parser needed a leading '+'
in its optstring to preserve its pre-migration flags-only-before-
positionals behavior. Also fixes bug-1704: cmd_qctrl's uninitialized
action variable, now sentineled and rejected when unset, mirroring
cmd_hostctrl's existing pattern -- this also makes the destructive-
command gate's -i/-c detection (task 3.3) safe to rely on. Every
existing short flag's letter, value format, and default is unchanged
for a valid invocation. 1357/1357 across the full controller suite
(+4), 0 regressions.

Task 3.1 of .kiro/specs/xce-test-cli-ux/tasks.md.
Requirements: 2.1, 2.2, 2.3, 2.4, 6.1, 6.2, 6.3, 6.4, 10.1, 10.2, 10.3

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019jaMf9QEwpugH2W9KAuc7f
This commit is contained in:
Rongsong Shen 2026-09-09 17:27:48 +00:00
parent 878a42fb48
commit f152c59e75
No known key found for this signature in database
GPG key ID: 5BCDAAE0123E9FE2
6 changed files with 883 additions and 92 deletions

View file

@ -435,6 +435,8 @@ test('joblist display test', joblist_display_unit_test,
join_worker_args_unit_test_src = [
'testsuite/test_join_worker_args.c',
'testsuite/join_worker_args.c',
'testsuite/flagspec.c', # xce-test-cli-ux task 3.1: join_worker_parse_attrs
# migrated onto flagspec_build_opts/flagspec_reject
]
join_worker_args_unit_test = executable('join_worker_args_unit_test',