zquestz / s

Open a web search in your terminal.
MIT License
2.34k stars 114 forks source link

Flag which would allow `s` to return URL #117

Closed aksr closed 8 years ago

aksr commented 8 years ago

It would be nice if s could return URL. Something like this could be useful:

firefox --new-tab "$(s -u -p wikipedia rhinos)"

(-u or -r or whatever you think is better)

There are other examples. What do you think?

Best regards.

zquestz commented 8 years ago

I think this is a good idea. I will look into it.

zquestz commented 8 years ago

Note you can already customize the binary and flags with -b... so you can do:

s -b "firefox --new-tab" -p wikipedia rhinos

Then you can alias that as a new command like alias sft='s -b "firefox --new-tab"'

aksr commented 8 years ago

Yes, I know, thank you. (but for some reason the above example doesn't work) Still, I think returning url isn't a bad idea—especially if you're using it with pipes.

zquestz commented 8 years ago

I went ahead and added an output only mode. You can pass -o to only output the URL now. Good suggestion. =)

Also you could have hacked it in before by changing the binary to echo. That's what I use for testing, but now I can just use the flag. =)

zquestz commented 8 years ago

New 0.5.7 release has this option and is building now. =)

aksr commented 8 years ago

Thank you. ;)