Include the answer link in the output by default #152

jericson opened this Issue Aug 15, 2016 · 1 comment


None yet

2 participants


By default, answers provided by howdoi come from Stack Overflow, which has an attribution policy. It's pretty typical to include a comment with a link to the SO answer when using code. (Even this project follows that convention.) If you use the -l option, you get a link to the answer (and no code), but there's no way to get the link and the code.

My suggestion is to keep the -l option the same and add a URL to the default output. This would also make the multiple answer output more useful:

$ howdoi copy table lua -n 2
--- ---
table.insert(MainTable, TempTable)

--- ---
shallow_copy = function(tab)
    local retval = {}
    for k, v in pairs(tab) do
        retval[k] = v
    return retval

I think that looks a lot better than "Answer 1" and "Answer 2".

(Disclosure: I work as a Community Manager [howdoi community manager] for Stack Overflow.)

gleitz commented Aug 15, 2016

Very nice suggestion, @jericson. I would be happy to accept a pull request with the URL included.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment