Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add completions for mdadm #4198

Merged
merged 2 commits into from
Jul 10, 2017
Merged

Add completions for mdadm #4198

merged 2 commits into from
Jul 10, 2017

Conversation

PenegalECI
Copy link
Contributor

@PenegalECI PenegalECI commented Jul 7, 2017

Description

This PR adds completions for mdadm, the Linux tool for maintaining software RAID. This has been developed using the man page, so it should be rather exhaustive, taking into account around 98% of use cases AFAIK, but there could be some lacks due to:

  • mdadm idiosyncrasies, like using the same short option for several long ones, or their different meanings in different contexts,
  • a misunderstanding of the man, being only a regular mdadm user, not an expert,
  • some specific combination of tags,
  • remaining bugs or typos, although I checked my code along the whole coding.

TODOs:

  • Changes to fish usage are reflected in user documentation/manpages.
  • Tests have been added for regressions fixed
  • User-visible changes noted in CHANGELOG.md

Copy link
Member

@faho faho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No literal tabs, use \t.

The rest seems nice.

# as their absence has already been checked, because this absence caused evaluation of __fish_not_contain_opt

function __fish_mdadm_metadata_options
echo "0 Use original 0.90 format superblock"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these literal tab characters?

I'd prefer it if we used the \t escape instead.

It's even possible to use something like

printf '%s\t%s\n' "0" "Use original 0.90 format superblock" \
                          "0.90" "Use original 0.90 format superblock"
# and so on

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or, a bit simpler:

echo "0"\t"Use original 0.90 format superblock"
echo "0.90"\t"..."

or countless variations. Anyway, please use \t, no tab characters in our files if we can help it.

@faho faho added this to the fish 2.7.0 milestone Jul 7, 2017
@krader1961
Copy link
Contributor

I agree with @faho. Do not include literal tabs (or other non-printable chars) in those strings since they are effectively invisible. Please use a symbolic representation like \t as @faho suggested so that it is obvious to anyone reading the script they are present.

@PenegalECI
Copy link
Contributor Author

Here you are.

@faho faho merged commit c577d01 into fish-shell:master Jul 10, 2017
@faho
Copy link
Member

faho commented Jul 10, 2017

And there you are - merged, thanks!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants