On 12/04/2015 12:56 AM, Brian (bex) Exelbierd wrote: > On Nov 23, 2015, at 8:17 PM, Daniel J Walsh <dwalsh redhat com> wrote: >> >> On 11/22/2015 11:09 AM, Brian (bex) Exelbierd wrote: >>> >>> 2) Could argument parsing in Atomic CLI be made more flexible than the current OPT system? Could the parser learn how to manage arguments like this: >>> >>> RUN: docker run -it $foo $bar:o container command $destination $* >>> >>> This is an attempt to specify the following substitutions: >>> >>> $foo = whatever the entirety of a --foo== or -foo= or -foo or --foo - required >>> $bar = the same as $foo for s/foo/bar/ but optional >>> $destination = same as $foo above with s/foo/destination/ >>> $* anything left over >>> >>> This fixes positional problems, add some error output, etc. >> I would prefer to see a real world examples. We now allow environment >> variables to be passed and we have --opt1, --opt2, --opt3 Not sure >> what we can't do now, that you want added. > > The goal with this suggestion isn't to add new functionality to make something possible, but to make the possible easier to understand. > > For example: > > RUN: docker run -it --rm --privileged -v `pwd`:/atomicapp -v /run:/run -v /:/host --net=host --name ${NAME} -e NAME=${NAME} -e IMAGE=${IMAGE} ${IMAGE} -v ${OPT2} run /atomicapp > > for a container needing a local mount would have to be invoked as: > > OPT2=/some/dir/some/where atomic run image > > However, a label like this: > > RUN: docker run -it --rm --privileged -v `pwd`:/atomicapp -v /run:/run -v /:/host --net=host --name ${NAME} -e NAME=${NAME} -e IMAGE=${IMAGE} ${IMAGE} $workdir run /atomicapp > > could be invoked in a more friendly way like this: > > atomic run image -workdir=/some/dir/some/where > > Is this more clear? We are working to fix the issues with the "opt" variables on our end. https://github.com/projectatomic/atomicapp/issues/332 |