Open ghostsquad opened 2 years ago
I think this is valuable, but it appears that native support for arg ...string
doesn't exist for the Session
in the ssh
package. I asked around in the Gopher slack server, and no one had a better idea, other than to essentially not use the ssh
package natively, and instead always use os.Exec
and call ssh
from there, which doesn't feel much better.
Maybe the right way to handle this would be to accept args []string
and shellquote each arg, then join(" ", quotedArgs)
?
I guess I'd have to write some tests.
https://github.com/frioux/leatherman/tree/main/pkg/shellquote
@pgavlin might have more insight here - we certainly welcome code changes but I want to make sure you're aligned in direction. <3
Hello!
Issue details
Using
string
instead of[]string
for command means that the user must handle separating args, handling quoting issues, etc.I believe that a better user experience would be to allow the user to provide an array of args as well.