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

Add with tabry completion helper #7

Merged

Conversation

pfgray
Copy link
Contributor

@pfgray pfgray commented Sep 26, 2024

This commit adds a nix helper for binding tabry completion files with
nix packages. The withTabry function is a nix function that takes a
tabry completion file and a nix package and returns a derivation that
installs the completion file in the package's completion directory.

example usage:

wrappedCommand = withTabry ./command.tabry <pkg>

@pfgray pfgray force-pushed the add_withTabry_completion_helper branch 2 times, most recently from 98467b9 to e3e40c9 Compare October 13, 2024 04:25
@pfgray pfgray changed the title WIP Add with tabry completion helper Add with tabry completion helper Oct 13, 2024
@pfgray
Copy link
Contributor Author

pfgray commented Oct 13, 2024

@evanbattaglia , this is ready for some 👀

@evanbattaglia
Copy link
Owner

Thanks for doing this! Sorry I took so long to look at it. Looks good, the only thing I don't like about it is the fish script is no longer directly runnable, which is nice when developing the script. (The bash script seems to work ok running the template script directly). What do you think about using a template/sentinel value that is ok to have in the function name, like TABRY_FUNCTION_NAME_PLACEHOLDER (no braces)? Do you see a big disadvantage in that? I guess when developing, it's not a big deal to do a sed s/{{UNIQ_FN_NAME}}//g tabry-fish.fish | source, I guess it will probably keep line numbers intact, but it seems like we might as well just keep it runnable directly.

@pfgray
Copy link
Contributor Author

pfgray commented Nov 12, 2024

What do you think about using a template/sentinel value that is ok to have in the function name

Good idea, I'll make that change!

This commit adds a nix helper for binding tabry completion files with
nix packages. The `withTabry` function is a nix function that takes a
tabry completion file and a nix package and returns a derivation that
installs the completion file in the package's completion directory.

example usage:

```nix
wrappedCommand = withTabry ./command.tabry <pkg>
```
@pfgray pfgray force-pushed the add_withTabry_completion_helper branch from e3e40c9 to dda8d7a Compare November 13, 2024 19:17
@evanbattaglia evanbattaglia merged commit 9d5533f into evanbattaglia:master Nov 13, 2024
1 check passed
@evanbattaglia
Copy link
Owner

Thanks!

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