zquestz / s

Open a web search in your terminal.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Flag which would allow `s` to return URL

aksr opened this issue · comments

commented

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.

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

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"'

commented

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.

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. =)

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

commented

Thank you. ;)