[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC PATCH] vl.c: add -semihosting-config "arg" sub-arg
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [RFC PATCH] vl.c: add -semihosting-config "arg" sub-argument |
Date: |
Tue, 21 Apr 2015 16:55:12 +0100 |
On 21 April 2015 at 16:14, Liviu Ionescu <address@hidden> wrote:
> if you insist on the arg= solution, could you be so kind and
> provide a bash script wrapper that passes all arguments ($@)
> using your syntax?
If you're willing to accept bashisms, then:
argstr=""
for arg in "$@"; do
argstr=${argstr:+$argstr,}arg=${arg//,/,,}
done
qemu-system-arm --semihosting-options "$argstr"
If you want pure POSIX shell then it is slightly
uglier as we have to invoke sed:
argstr=""
for arg in "$@"; do
o=$(printf '%s.\n' "$arg" | sed s/,/,,/g)
argstr=${argstr:+$argstr,}arg=${o%.}
done
qemu-system-arm --semihosting-options "$argstr"
(Note the trick with the '.' to ensure correct handling
of trailing newlines in arguments; credit to mdw for
that one.)
-- PMM
- Re: [Qemu-devel] [RFC PATCH] vl.c: add -semihosting-config "arg" sub-argument, (continued)
- Re: [Qemu-devel] [RFC PATCH] vl.c: add -semihosting-config "arg" sub-argument, Leon Alrae, 2015/04/15
- Re: [Qemu-devel] [RFC PATCH] vl.c: add -semihosting-config "arg" sub-argument, Matthew Fortune, 2015/04/15
- Re: [Qemu-devel] [RFC PATCH] vl.c: add -semihosting-config "arg" sub-argument, Liviu Ionescu, 2015/04/15
- Re: [Qemu-devel] [RFC PATCH] vl.c: add -semihosting-config "arg" sub-argument, Leon Alrae, 2015/04/15
- Re: [Qemu-devel] [RFC PATCH] vl.c: add -semihosting-config "arg" sub-argument, Liviu Ionescu, 2015/04/15
- Re: [Qemu-devel] [RFC PATCH] vl.c: add -semihosting-config "arg" sub-argument, Leon Alrae, 2015/04/16
- Re: [Qemu-devel] [RFC PATCH] vl.c: add -semihosting-config "arg" sub-argument, Liviu Ionescu, 2015/04/17
- Re: [Qemu-devel] [RFC PATCH] vl.c: add -semihosting-config "arg" sub-argument, Peter Maydell, 2015/04/16
- Re: [Qemu-devel] [RFC PATCH] vl.c: add -semihosting-config "arg" sub-argument, Leon Alrae, 2015/04/21
- Re: [Qemu-devel] [RFC PATCH] vl.c: add -semihosting-config "arg" sub-argument, Liviu Ionescu, 2015/04/21
- Re: [Qemu-devel] [RFC PATCH] vl.c: add -semihosting-config "arg" sub-argument,
Peter Maydell <=
- Re: [Qemu-devel] [RFC PATCH] vl.c: add -semihosting-config "arg" sub-argument, Liviu Ionescu, 2015/04/21
- Re: [Qemu-devel] [RFC PATCH] vl.c: add -semihosting-config "arg" sub-argument, Peter Maydell, 2015/04/21
- Re: [Qemu-devel] [RFC PATCH] vl.c: add -semihosting-config "arg" sub-argument, Liviu Ionescu, 2015/04/21
- Re: [Qemu-devel] [RFC PATCH] vl.c: add -semihosting-config "arg" sub-argument, Peter Maydell, 2015/04/21
- Re: [Qemu-devel] [RFC PATCH] vl.c: add -semihosting-config "arg" sub-argument, Eric Blake, 2015/04/21
- Re: [Qemu-devel] [RFC PATCH] vl.c: add -semihosting-config "arg" sub-argument, Peter Maydell, 2015/04/21
- Re: [Qemu-devel] [RFC PATCH] vl.c: add -semihosting-config "arg" sub-argument, Eric Blake, 2015/04/21
- Re: [Qemu-devel] [RFC PATCH] vl.c: add -semihosting-config "arg" sub-argument, Liviu Ionescu, 2015/04/21
- Re: [Qemu-devel] [RFC PATCH] vl.c: add -semihosting-config "arg" sub-argument, Liviu Ionescu, 2015/04/21
- Re: [Qemu-devel] [RFC PATCH] vl.c: add -semihosting-config "arg" sub-argument, Leon Alrae, 2015/04/23