wckr / wocker-cli-host

5 stars 3 forks source link

Use ssh-config to execute ssh faster #1

Closed ailispaw closed 8 years ago

ailispaw commented 8 years ago

and, other commands just pass through and should be evaluated by wocker-cli at the VM side.

And also I found a bug at the case of 'network' and 'volume' subcommands in wocker-cli at the VM. 'network connect' | 'network create' | 'network disconnect' | 'network inspect' | 'network ls' | 'network rm' should be 'network' and 'volume create' | 'volume inspect' | 'volume ls' | 'volume rm' should be 'volume'.

ailispaw commented 8 years ago

It works fine so far, but I'm not sure of its quote handling.

ixkaito commented 8 years ago

@ailispaw Thanks. LGTM! However, if running wocker commands in sub directories, this will create .ssh_config everywhere. Do you have any ideas to avoid it?

ixkaito commented 8 years ago

@ailispaw Quotes handle variable issues, but I forgot the details.

ailispaw commented 8 years ago

However, if running wocker commands in sub directories, this will create .ssh_config everywhere. Do you have any ideas to avoid it?

Ah! I will try.

ixkaito commented 8 years ago

@ailispaw And, if the VM is not running, for the first time to execute wocker commands will create an empty .ssh_config.

ailispaw commented 8 years ago

I see.

ailispaw commented 8 years ago

@ixkaito I think it works fine with the edge cases now, except quotes handling.

ailispaw commented 8 years ago

Need squash?

ixkaito commented 8 years ago

@ailispaw Thanks! The .ssh_config issue was solved well, but the here document seems not to handle arguments well. If there are two or more arguments (sub commands + one or more arguments), the sub commands will not be executed e.g. wocker ps -a.

Need squash?

No, it's OK.

ailispaw commented 8 years ago

I see.

Line. 21 "$@" -> $@ will work. But i'm concerned about a parameter with quotes/spaces. Hmm.

ailispaw commented 8 years ago

But it seems that most cases are fine, because a space is not allowed within a container name.

ailispaw commented 8 years ago

trap "rm -f '${SSH_CONFIG}'" ERR remove .ssh_config on every error. I would like to distinguish ssh errors from wocker command errors and even help command.

ailispaw commented 8 years ago

FYI: I made an another cli tool for a generic purpose. It's inspired by this. https://github.com/bargees/barge-cli

ixkaito commented 8 years ago

@ailispaw Thank you for your great effort and support. Works well! I reverted Vagrant commands as fallbacks, for I don't want to update these commands when I add/remove features of them. Also fixed the bug of network and volume in Wocker CLI.

ailispaw commented 8 years ago

My pleasure.

I reverted Vagrant commands as fallbacks, for I don't want to update these commands when I add/remove features of them.

I understand. :)