chipsenkbeil / choose

Fuzzy matcher for OS X that uses both std{in,out} and a native GUI
Other
418 stars 19 forks source link

feature request: return string for non-items #6

Closed yoavg closed 4 years ago

yoavg commented 8 years ago

First of, I'd like to say huge thanks for writing 'choose'. I am coming to OSX from Linux (with dmenu) and was looking all over the place for something like this. So, thanks! this is really really helpful, and working great.

There is one small capability I am missing, though: When I type in a string that does not match any of the items on the list, and then press "Enter", I'd like 'choose' to not perform cancel, but instead to return the string that I entered. If I wanted to cancel, I could still do it using the Esc key. This way, I could distinguish between two cases: (1) I canceled because I changed my mind (2) I did not find the item I was looking for, which was actually string X.

It looks like a tiny change (changing line 459 to write the queryField instead of canceling?), but unfortunately I don't know Objective-C at all and am afraid I'll be missing something. Also, I really don't want to install the full-blown xcode suite just for this :(

Thanks again for your consideration!

thesoftwarephilosopher commented 8 years ago

I like the idea!

thesoftwarephilosopher commented 8 years ago

@yoavg It looks like you're right about what line to change. Wanna make the change you're suggesting?

yoavg commented 8 years ago

As I said, I never used Obj-C before, and while I managed to locate the needed line, all the syntax looks very foreign to me. If you could make this change yourself, that will be super :) Otherwise, I'll install xcode tomorrow or the next day and find the time to give it a shot myself.

thanks again.

bricef commented 6 years ago

I manually built choose from the latest master and the flag is now working for me.

Could we get a new version with these changes so that they're included in the brew install choose-gui default?

thesoftwarephilosopher commented 6 years ago

Good idea.

VonbatenBach commented 4 years ago

I manually built choose from the latest master and the flag is now working for me.

Could we get a new version with these changes so that they're included in the brew install choose-gui default?

Hi, I know it's been a few years, but could you tell me how to manually build choose from master or give any script?

chipsenkbeil commented 4 years ago

@VonbatenBach, there's an included makefile where you can run make and it will build choose for you. The primary command to run is xcodebuild clean build if you don't want to run make.

VonbatenBach commented 4 years ago

After make I have the binary file of choose in build/Release/, am I right? Then I probably should symlink it to other bins, such as/usr/local/bin/ directory, and I will be able to use choose in the same way as it was installed by brew?

chipsenkbeil commented 4 years ago

@VonbatenBach , it should drop a copy of the newly-built binary into the root of the project directory as choose, but you can also find it at build/Release/choose.

These days, I recommend folks have a bin/ directory within their home directory and place custom binaries there if not managed by a package manager. You can add $HOME/bin to your path, earlier in the list of paths than others for that binary to take precedence.

VonbatenBach commented 4 years ago

Ok, thank you. Works for me. May I also ask about the feature discussed primarily in this thread? I thought it was implemented, but choose still returns only selected items, when I type any string not matching these items and press enter, my stdout returns ' '.

EDIT: Now I see option '-m'. Sorry for problem.

chipsenkbeil commented 4 years ago

Closing this out as the feature has already been implemented. A new binary needs to be released at some point to reflect the addition.