runfinch / finch

The Finch CLI is an open source client for container development
https://www.runfinch.com
Apache License 2.0
3.48k stars 87 forks source link

fix: parse management commands with proper arguments #830

Closed mharwani closed 3 months ago

mharwani commented 4 months ago

Issue #, if available: #827

Description of changes: Addresses #827 by parsing management command names into a single command. For eg, ["finch", "container", "run", "alpine", ...] will be parsed as ["finch", "container run", "alpine", ...], so that "run" is passed as a command rather than an argument.

Testing done: Changes tested locally to ensure that the issue is fixed.

$ ./_output/bin/finch container run --debug -it --rm --env="E=v" busybox env
DEBU[0000] Creating limactl command: ARGUMENTS: [shell finch sudo -E nerdctl container run -e E=v -it --rm busybox env], LIMA_HOME: /Users/mharwani/work/runfinch/finch/_output/lima/data 
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
E=v
TERM=xterm
HOME=/root

License Acceptance

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.