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

Install shell completions when using installation script #71

Closed
1 of 3 tasks
marcospb19 opened this issue Oct 7, 2021 · 11 comments
Closed
1 of 3 tasks

Install shell completions when using installation script #71

marcospb19 opened this issue Oct 7, 2021 · 11 comments
Labels
installation Related to the installation process of ouch
Milestone

Comments

@marcospb19
Copy link
Member

marcospb19 commented Oct 7, 2021

We should generate completions at least for zsh and bash.

Status update:

@marcospb19 marcospb19 added this to the 1.0.0 milestone Oct 7, 2021
@marcospb19 marcospb19 added the installation Related to the installation process of ouch label Oct 7, 2021
@figsoda
Copy link
Member

figsoda commented Oct 16, 2021

It would be hard to implement completion generation for the current oof
Maybe we should just handwrite completions or rewrite oof?

@marcospb19
Copy link
Member Author

I think that the best way it to migrate to clap, it will provide us with man pages as well as shell completions for various shells (maybe we should use a specific 3.0 beta version, while 3.0 stable is not released).

This will probably increase our binary size by 200kb, but there are various other advantages, saves us time worrying about argparsing and --help stuff (which is terrible to edit manually in ouch).

@figsoda
Copy link
Member

figsoda commented Oct 19, 2021

I didn't make the recommendation since it was previously removed
I am currently using clap{,_generate} beta and it works pretty well. I don't think clap_generate has man page support yet, but we can use help2man if we really want man pages

@marcospb19
Copy link
Member Author

Oh yeah, I think the default template of clap is compatible with help2man, we could have a build.rs file to do it, I'm not sure how it works tho.

Removing clap was a bad decision :P , but I only realized it later.

@figsoda
Copy link
Member

figsoda commented Oct 19, 2021

I have a build.rs for clap_generate completions, imo help2man shouldn't be in build.rs since it requires the built binary, we could just put in ci and rely on the package maintainers. I can help packaging for nixpkgs

@figsoda
Copy link
Member

figsoda commented Oct 19, 2021

actually i take that back, i dont think help2man would need the built binary and clap should have some function to get the full help message

@marcospb19
Copy link
Member Author

It's a weird idea to install shell completions with an installation script just copying files with sudo mv, for NixOS and Arch (with AUR) we can properly install with package managers, but for ubuntu users I guess it's our only option (and other debian-based systems).

@murlakatamenka
Copy link

Status update:

* [x]  Add completions to releases.

It's checked here but in releases there are only binaries, would be nice to see completions there, it's WIP as I understand.

@marcospb19
Copy link
Member Author

Oh yeah, I unchecked that one checkbox.

Taking a look again at this issue again, I'm questioning if installing shell completions with sudo in the users system is too aggressive or not, we already require sudo to move the binary to /usr/local/bin/ouch and I don't think there is another software with the same name.

@murlakatamenka
Copy link

@marcospb19 don't worry about that, obviously you need permissions to copy stuff to /usr/share/, so sudo is required.

The user will be prompted for password once since default sudo timeout is 5 minutes

man sudoers:

Once a user has been authenticated, [...] the user may then use sudo without a password for a short period of time (5 minutes unless by the timestamp_timeout option).

@marcospb19
Copy link
Member Author

marcospb19 commented Feb 7, 2023

We gave up on the installation scripts in favor of packages, after seeing that ouch is being packaged to a variety of systems.

The good part of packages is that they usually install completions correctly.

@marcospb19 marcospb19 closed this as not planned Won't fix, can't repro, duplicate, stale Feb 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
installation Related to the installation process of ouch
Projects
None yet
Development

No branches or pull requests

3 participants