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

debug: add mangen + nix: add completion/manpages to output #100

Merged
merged 3 commits into from
Mar 2, 2022

Conversation

colemickens
Copy link
Contributor

@colemickens colemickens commented Mar 2, 2022

Sorry, I didn't open an issue for this one. It started with a quick Nix fix and evolved. Let me know if you'd prefer it split, etc.

This:

  1. adds clap_mangen to cargo
  2. adds jj debug mangen subcommand
  3. uses the debug subcommands in the nix expression to enrich the package outputs

clap_mangen suggest possibly using in a build task, but I prefer, and wanted to match, the internal debug command pattern already used for completions.

  • Tests pass
  • Appropriate changes to README are included in PR

To be honest, I don't know what is normally done to install manpages, hence the lack of README change. Mine just works via nixos/home-manager.

demo: https://asciinema.org/a/zyx09Y2SWz6FuEihbUupl5TP1

  • first the nix config for a to-be-upstreamed home-manager module
  • man jj showing the manpage
  • jj <tab> showing completions
  • jj status <tab> showing arg completions

(demo created by utilizing my existing configuration, then sudo nixos-rebuild ~/code/nixcfg#porty --override-input jj ~/code/jj, and then just ran zellij in asciinema)

@martinvonz
Copy link
Member

Sorry, I didn't open an issue for this one.

No problem, I don't care about having an issue for each PR anyway. That was just something that came with Google's default PR template. I just merged a PR removing that from the template (#94).

It started with a quick Nix fix and evolved. Let me know if you'd prefer it split, etc.

This:

  1. adds clap_mangen to cargo
  2. adds jj debug mangen subcommand
  3. uses the debug subcommands in the nix expression to enrich the package outputs

Looks good. I would have squashed 1 into 2 because the new dependency on its own isn't useful or tested.

clap_mangen suggest possibly using in a build task, but I prefer, and wanted to match, the internal debug command pattern already used for completions.

Thanks. One advantage of doing it in the debug command is that it's guaranteed to match the binary.

To be honest, I don't know what is normally done to install manpages, hence the lack of README change. Mine just works via nixos/home-manager.

https://askubuntu.com/questions/244809/how-do-i-manually-install-a-man-page-file says put it in /usr/local/share/man/man1/ (on Ubuntu anyway), but that can be done later.

demo: https://asciinema.org/a/zyx09Y2SWz6FuEihbUupl5TP1

  • first the nix config for a to-be-upstreamed home-manager module
  • man jj showing the manpage
  • jj <tab> showing completions
  • jj status <tab> showing arg completions

(demo created by utilizing my existing configuration, then sudo nixos-rebuild ~/code/nixcfg#porty --override-input jj ~/code/jj, and then just ran zellij in asciinema)

Nice. Thanks!

@martinvonz martinvonz merged commit 2a6ab8b into jj-vcs:main Mar 2, 2022
@martinvonz martinvonz mentioned this pull request Apr 3, 2022
1 task
@colemickens colemickens deleted the mangen_nix_completion branch February 22, 2024 04:52
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