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

fish_update_completions includes non-argument text from descriptions #4313

Closed
mqudsi opened this Issue Aug 11, 2017 · 2 comments

Comments

Projects
None yet
3 participants
@mqudsi
Copy link
Contributor

mqudsi commented Aug 11, 2017

Running fish_update_completions results in these invalid completions being added to the s3cmd autogenerated completions file:

complete -c s3cmd -l '(r)exclude(-from' --description '.'
complete -c s3cmd -l 'guess-mime-type.' --description '.'

The first is caused by this line in the man file:

   --include=GLOB
          Filenames  and  paths  matching  GLOB  will  be  included  even  if  previously  excluded  by   one   of
          --(r)exclude(-from) patterns

Is it ok to exclude ( and ) from the search regex? I don't think I've ever seen a unix command that has a parentheses in an argument in all my years, no matter how misguided the developer (though I'm sure somewhere out there such a command does exist).

The second is caused by this line in the man file:

   -m MIME/TYPE, --mime-type=MIME/TYPE
          Force MIME-type. Override both --default-mime-type and --guess-mime-type.

Same question: can we exclude punctuation from the argument search regex? If not, we can surely exclude trailing punctuation, right?

@faho faho added the enhancement label Aug 11, 2017

@faho

This comment has been minimized.

Copy link
Member

faho commented Aug 11, 2017

Is it ok to exclude ( and ) from the search regex?

Yes. I'd actually be okay with going further. Do we already exclude "{" and "}"?

I'd rather miss an option than have something like this included.

Same question: can we exclude punctuation from the argument search regex? If not, we can surely exclude trailing punctuation, right?

I don't see why not.

mqudsi added a commit that referenced this issue Aug 11, 2017

Ignore more invalid arguments from parsed man pages
Specifically closes #4313.
Not being as agressive in what we ignore/blacklist, but can be revisited
easily in the future to add more characters to the argument blacklist.

@mqudsi mqudsi closed this in 67f7e53 Aug 11, 2017

@mqudsi mqudsi self-assigned this Aug 11, 2017

@mqudsi

This comment has been minimized.

Copy link
Contributor

mqudsi commented Aug 11, 2017

@faho thanks for the suggestion, I'm excluding those as well.

Also trimming trailing punctuation to handle (theoretical) cases like "bla bla bla --foo-bar: used to bla bla bla", etc.

@krader1961 krader1961 added this to the fish 2.7.0 milestone Aug 11, 2017

krader1961 added a commit that referenced this issue Aug 15, 2017

Ignore more invalid arguments from parsed man pages
Specifically closes #4313.
Not being as agressive in what we ignore/blacklist, but can be revisited
easily in the future to add more characters to the argument blacklist.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment