nix-community / comma

Comma runs software without installing it. [maintainers=@Artturin,@burke,@DavHau]
1.14k stars 50 forks source link

[feature request] disable picker by using exact match #59

Open andrewcrook opened 1 year ago

andrewcrook commented 1 year ago

Would be good to have an option to disable the picker to use an exact match instead

Artturin commented 1 year ago

So , --exact hello should not open the picker but instead pick hello.out ?

andrewcrook commented 1 year ago

So , --exact hello should not open the picker but instead pick hello.out ?

yes you got it

zeorin commented 1 year ago

Might be useful to cache previous choices by default (with an option to ignore that history if desired). Just print to the console that previous choice was used from amongst the available options. Also ignore previous choice when choice set has new options compared to when the stored choice was made.

eth3lbert commented 11 months ago

I've also get around this by utilizing the fzf picker which provide query and auto select the only match functionality. e.g. cargo run -- --picker fzf --picker-args --select-1 --query 311 -- pipdeptree --python /some/path/.venv/bin/python

It's simple to implement and works quite well but the downside is that not all picker have such option to auto select, and I do think provide a option to further filter (either exact or regex) would be a better approach.

diniamo commented 6 months ago

At that point, why not just use nix run?

iofq commented 2 months ago

maybe I am confused here but nix run doesn't help if you don't know which package/flake contains the command?

diniamo commented 2 months ago

You do though, the idea is that the command is the same as the package name, so comma should just pick it instantly instead of opening the picker.

tupakkatapa commented 2 months ago

Following this and being confused about the feature request, I can see why someone might want a feature to automatically pick the first match. Initially, I thought this meant that, and I would like to have that as an option, but exact match doesn't make any sense to me.

I mean, why just not, i.e. nix-shell -p hello instead.