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

Improve template #12

Closed
wants to merge 1 commit into from
Closed

Improve template #12

wants to merge 1 commit into from

Conversation

TruncatedDinoSour
Copy link
Contributor

No description provided.

@DannyBen
Copy link
Owner

Thanks. Why is this better?

@TruncatedDinoSour
Copy link
Contributor Author

Thanks. Why is this better?

Hey :)

  • The shbang is useless and the top helps with docs
  • It keeps some bash features for completion, like it gives some autocompletion in some way
  • Ex notation is recognised by a lot more editors
  • Sometimes completion might fail and you might get an error

@DannyBen
Copy link
Owner

DannyBen commented May 16, 2022

Ok. What do we gain from this:

-o bashdefault -o default

and more importantly, could this be NOT desired in some cases?
I do not see it in any other completion script (while I do see the other proposed changes).

@TruncatedDinoSour
Copy link
Contributor Author

Ok. What do we gain from this:

-o bashdefault -o default

and more importantly, could this be NOT desired in some cases? I do not see it in any other completion script (while I do see the other proposed changes).

The always complete thing

@DannyBen
Copy link
Owner

The always complete thing

I don't understand what that means. What behavior does it add exactly.

Also this line:

 _init_completion -s || return

breaks the tests. Specifically this test:

context "with just the command name" do
it "shows all completions" do
expect(subject).to eq %w[--help --version download list upload]
end
end

The result is an empty array. Also tried defining the locals before the _init_completion, but same.

@DannyBen
Copy link
Owner

I think I found the problem. Need to source source /usr/share/bash-completion/bash_completion in the test script.

I will probably create a new PR with the fixed tests to supersede this one, but unless there is a good reason to keep thises -o bashdefault -o default, I might remove them.

@DannyBen DannyBen mentioned this pull request May 16, 2022
@DannyBen
Copy link
Owner

I am closing this in favor of #13 - let's continue discussion there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants