flux-framework / flux-core

core services for the Flux resource management framework
GNU Lesser General Public License v3.0
159 stars 49 forks source link

etc: update bash completions #6039

Closed grondo closed 1 week ago

grondo commented 2 weeks ago

This PR reworks the bash completions to fix a bunch of annoyances I've found over time:

Here completions are reworked to use a scheme that more closely matches the bash-completion project. The _split_longopts() function is borrowed from that project and this function is used to split long options at the = so completion can be unified between short, long and long with = (This is typically done with a case statement as you'll see in the code)

Since this new scheme is closer to bash-completion, we could eventually update to requiring that project more easily (it has lots of nice improvements and helper functions)

grondo commented 1 week ago

Thanks, I've set MWP.

codecov[bot] commented 1 week ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 83.35%. Comparing base (1cc9b8c) to head (cd54f1d).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #6039 +/- ## ========================================== + Coverage 83.32% 83.35% +0.03% ========================================== Files 519 519 Lines 83734 83734 ========================================== + Hits 69770 69796 +26 + Misses 13964 13938 -26 ``` [see 9 files with indirect coverage changes](https://app.codecov.io/gh/flux-framework/flux-core/pull/6039/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=flux-framework)