osteensco / fastTravelCLI

The better CD command
6 stars 1 forks source link

add ? command #18

Closed osteensco closed 2 weeks ago

osteensco commented 3 weeks ago

add a command that asks fastTravelCLI if the current working dir is a key thats saved

ft ?
anveshthakur commented 3 weeks ago

hi @osteensco, do you think we can use something like this for this feature? https://github.com/vishalkuo/bimap

osteensco commented 3 weeks ago

We wouldn't need an additional tool, this should be just a simple look up in fastTravel's map.

anveshthakur commented 3 weeks ago

got your point @osteensco , I just wanted to avoid a linear search and wanted to implement it with a bidirectional map if you think it is not required I'll just go ahead and implement it?

osteensco commented 3 weeks ago

I dont think its really necessary right now, I imagine most use cases of fastTravel would have less than 50 keys. If fastTravel picks up users and it surfaces as a problem for some then I'd revisit implementing a bidirectional map at that point.

anveshthakur commented 2 weeks ago

Makes sense @osteensco , I'll work on it and raise a PR.

Thanks!

anveshthakur commented 2 weeks ago

hi @osteensco, There is a slight issue with this zsh considers ? as a wildcard to match any single character in filenames. so whenver I am executing this command I am getting this

ft ?
zsh: no matches found: ?

so we either have to escape it like ft \? in zsh or we have to come up with a new command for this.

osteensco commented 2 weeks ago

Yea I thought this might be the case. So some alternatives:

-here -this -is

Open to other alternatives if you have suggestions.

anveshthakur commented 2 weeks ago

I think the shorter the better, -is should be fine.