KatharaFramework / Kathara

A lightweight container-based network emulation system.
https://www.kathara.org/
GNU General Public License v3.0
462 stars 64 forks source link

Change `kathara exec` command execution behaviour to be consistent with `docker exec` and `kubectl exec` #299

Closed GioBar00 closed 5 months ago

GioBar00 commented 5 months ago

Feature Description

The way the kathara exec behaves if different from docker exec and kubectl exec. In Kathara when executing for example

kathara exec device_name echo ciao

echo and ciao would be interpreted as two different commands.

In Docker or Kubectl the ciao would instead be interpreted as an argument of the echo command and correctly printed on the screen. I guess the behaviour in intended like this in order to be able to execute multiple commands in a virtual device with a single kathara exec, but I think that it would be best to be consistent with docker and kubectl and just run separate kathara exec commands to replicate the current behaviour.

Skazza94 commented 5 months ago

Hi @GioBar00, the correct way to use it is with the double-dash separator:

kathara exec device_name -- echo ciao

We converged to this version after experimenting with different styles over time, since it's the more flexible when coming to passing complex commands.

Hope this solves your problem.

Mariano.

GioBar00 commented 5 months ago

Yes, thanks. Then I guess is just the documentation that is not updated.

Skazza94 commented 5 months ago

Probably yes, if you want, you could open a PR and update it. Would be great!

Cheers, Mariano.

GioBar00 commented 5 months ago

I will wait for the next release since it is about to merge and then I will look into it. For now thanks.

Best, Giovanni