zcomet icon indicating copy to clipboard operation
zcomet copied to clipboard

Feature Request: subcommand for adding file to path

Open Mukundan314 opened this issue 2 years ago • 2 comments

It would be nice to have a subcommand to download a file, add executable permissions, and add it to $PATH

usage I am thinking of:

zcomet bin <location of script> <name of binary>

zcomet bin https://raw.githubusercontent.com/dylanaraps/neofetch/master/neofetch neofetch
zcomet bin http://ix.io/client ix

would be happy to submit a pr for this.

If you feel that this is not within the scope of what zcomet is trying to achieve feel free to close this issue

Mukundan314 avatar Nov 20 '21 08:11 Mukundan314

A feature like that makes sense. It would also be easy to implement. The one thing I don't want to do, though, is to make design choices that I'll regret later, so if I add a bin subcommand, or something like it, I want to make sure that I'm really happy with it and that it will be easy to extend in the future without altering the fundamental simplicity of zcomet's syntax.

Can you be patient while I spend a couple of weeks experimenting with possibilities? I may ask you to test the new feature with me.

And thanks so much for the suggestion.

By the way, the examples you gave are really good ones. Could you continue to think of other examples? I'm particularly looking for difficult cases so that I can figure out how to handle them as smoothly as possible.

agkozak avatar Nov 20 '21 19:11 agkozak

I already have the code to handle "snippets," and that pretty much covers what you propose - I just need to place the target scripts in the PATH, probably in ~/.zcomet/polaris/bin -- and make sure they're executable. But even more common will be the use case where someone wants to add a subdirectory of a Git repository to PATH. That already occurs automatically when a bin/ subdirectory exists. What I need to do is to come up with the perfect set of subcommands to handle all of this stuff. That's what I'll be debating with myself.

agkozak avatar Nov 20 '21 21:11 agkozak