-
Notifications
You must be signed in to change notification settings - Fork 15
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 bash completions #62
Conversation
I'd probably add a hidden function to sdbootutil that can be eval'd from the completion script to avoid duplicating all that code |
I've looked a bit into how bash completion works and it seems like the bash completion has to happen in the same shell context. So I can A) source the sdbootutil script, but that would execute the functions that might fail as the bash completion can be called as non-super user Or do you have a different idea? |
43e9277
to
cbd35fe
Compare
something like |
a5d7b01
to
c4d47d4
Compare
I've tried to implement this. I couldn't test it yet though, but please tell me if this is what you had in mind :) |
a93f9a9
to
9e50d0c
Compare
da4439b
to
7e20590
Compare
92f03a7
to
b64cdb5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
almost there
40a7578
to
588ed4b
Compare
@aplanas can you have a look at this one please? :) |
5b8c2a1
to
2857228
Compare
2857228
to
4ab8cdc
Compare
@TobiPeterG the PR is looking good. Give me some time to test it a bit |
Should I just rebase or do you have any issues with the functionality/code that I should fix with a rebase? |
Yes please, do a rebase. But I need to research a bit more. I found a good reference |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can split this PR is two: one for all the bash completions, but another one for the commands refactoring. This last part is the main source of conflicts right now
4ab8cdc
to
2355afa
Compare
Now depends on #172 I have refactored this PR and split it into multiple commits. Please have a look :) |
To also support snapshots as completion, it would be the easiest to add a new option "--snapshot" that I can check for i nthe completion script. Otherwise it's impossible to know if the user wants to add an option or a snapshot number and I don't want to show both in one list. |
2355afa
to
0dd2830
Compare
Rebased :) I added the "_none" function when no completion is useful. |
0dd2830
to
d8cb76b
Compare
Signed-off-by: TobiPeterG <[email protected]>
Signed-off-by: TobiPeterG <[email protected]>
Signed-off-by: TobiPeterG <[email protected]>
Signed-off-by: TobiPeterG <[email protected]>
Signed-off-by: TobiPeterG <[email protected]>
d8cb76b
to
7c61b5c
Compare
@aplanas Rebased :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would merge it after the commented issue
Signed-off-by: TobiPeterG <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry that this takes so long : (
And thanks!
Many changes after this request of change
All good :) |
This will complete started commands and provide a list of possible commands and options.
Closes #61
Unfortunately, we can't access the available snapshots, so the user still has to know which ones are available on his system. Equally, we can't enter snapshots to find kernel versions, so we recommend only the currently installed kernels.