Skip to content

RFC Rewrite the check argument parsing

Zorro Lang fstests 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest4 patches 8 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4check: refactor argument parsing with getoptcheck+126 -534 replies
2/4check: update usage and README to reflect new argument parsingREADME README.overlay check +2 more+63 -601 reply
3/4check: consolidate argument handling into functioncheck+172 -1611 reply
4/4check: add deprecated options warningcheck+59 -131 reply

Reviews trailers per patch

All 4 patches have a Reviewed-by or Acked-by.

PatchOjaswin Mujoo
1/4R-b
2/4R-b
3/4R-b
4/4R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [RFC PATCH 0/4] Rewrite the check argument parsing

The patchset here were motivated by a previous RFC discussion regarding:
https://lore.kernel.org/fstests/afzmt7SFA4jWhi6U@zlang-mailbox/T/#t

This patchset refactors the argument parsing logic in the 'check' script. The current positional parameter handling is becoming hard to maintain as we add more options.

I've replaced the manual parsing loop with *getopt* to provide a more standard CLI experience, and ensured the functionality remains identical to the previous implementation.

Besides that, I also tried to make below 3 changes:
1) Introduced --fs <fstyp> option, to replace all those filesystem-specific options, e.g. -nfs, -overlay, -cifs and so on.
2) Updated all long-format options to strictly use the double-dash (--) prefix.
3) For backward compatibility, I tried to support legacy non-standard options to ensure existing user workflows aren't broken. A deprecation warning is now issued when these old options are used.

I hope this patchset can facilitate future additions and adjustments to arguments, making the code logic cleaner and more standardized.

Any concerns or review points, please feel free to tell me :)

Thanks,
Zorro

Zorro Lang (4):
check: refactor argument parsing with getopt
check: update usage and README to reflect new argument parsing
check: consolidate argument handling into function
check: add deprecated options warning

 README         |  10 +-
 README.overlay |  18 +-
 check          | 435 ++++++++++++++++++++++++++++++++-----------------
 common/config  |   8 +-
 common/rc      |   2 +-
 5 files changed, 303 insertions(+), 170 deletions(-)
Signature · 1 line
2.54.0