bash-it icon indicating copy to clipboard operation
bash-it copied to clipboard

getopt completion

Open EmilyGraceSeville7cf opened this issue 3 years ago • 4 comments

Description

Motivation and Context

How Has This Been Tested?

Completion tested manually inside interactive Bash session.

Screenshots (if appropriate):

image

Types of changes

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [x] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • [ ] My code follows the code style of this project.
  • [ ] If my change requires a change to the documentation, I have updated the documentation accordingly.
  • [ ] I have read the CONTRIBUTING document.
  • [ ] If I have added a new file, I also added it to clean_files.txt and formatted it using lint_clean_files.sh.
  • [ ] I have added tests to cover my changes, and all the new and existing tests pass.

EmilyGraceSeville7cf avatar Nov 23 '21 07:11 EmilyGraceSeville7cf

Hi @EmilySeville7cfg !

So this looks interesting but I'm not quite sure its really useful?

getopt isn't a command that people usually enter on the command line, is it?

Isn't it mostly used within your script to parse your script's arguments?

Do you use this completion as a testing tool when configuring getopt in your scripts?

I'm not sure how completion against the getopt command line options themselves is useful?

I'm not rejecting this PR, but just wanting to have more conversation about how its used

davidpfarrell avatar Nov 23 '21 23:11 davidpfarrell

Isn't it mostly used within your script to parse your script's arguments?

Yes, but sometimes it can be used from interactive session to test something. ;)

Do you use this completion as a testing tool when configuring getopt in your scripts?

Yes, because it's convenient to see available option values for getopt while typing. I don't want to run any other command to see available functions for instance, I can use just -n|--name option complete to explore them.

I don't know where better send such PRs: here or to bash-completion repo.

EmilyGraceSeville7cf avatar Nov 24 '21 03:11 EmilyGraceSeville7cf

$0.02: I would like having this available. Should note that it requires modern Bash, not the old v3.2 on Mac (😞).

gaelicWizard avatar Dec 27 '21 20:12 gaelicWizard

I don't know where better send such PRs: here or to bash-completion repo.

I think bash-completion would be a better parent for this, but IMHO I'm alsö happy to have it here until it goes there 😃

gaelicWizard avatar Dec 27 '21 20:12 gaelicWizard