driv / upto

Bash command that allows to go up to a certain directory
MIT License
126 stars 6 forks source link

handle duplicates in $PWD #10

Open blaenk opened 8 years ago

blaenk commented 8 years ago

Currently if you're in a directory that has multiple ancestor directories with the same name it'll always jump to the highest one, the closest one to the root. Perhaps there should be a way to disambiguate the duplicates.

driv commented 8 years ago

At the moment, the only way to disambiguate is to add something else to the pattern.

e.g. Directory: a/b/c/test/d/test/e/f upto d/test will go to the lower one. upto test will go to the higher one.

Probably the default behavior is incorrect and it should stop at the first one. If this was the behavior I cannot think of a faster way for a user than to just repeat the command if you want to go to the higher one.

Any ideas?

blaenk commented 8 years ago

Yeah that would probably be best, to stop at the first one, then they can repeat.