subuser-security/subuser — pull request #107 by peter1000 (2014-02-21 13:01:14+00:00)
Title: Addition/improvements to utils.py

https://github.com/subuser-security/subuser/issues/61

improved subprocessCheckedCall: argument: addToErrorInfo
e.g.code

```
subuserlib.utils.subprocessCheckedCall(["docker", "-d"], "ATTENTION: Special added info bla bla")
```
output

```
[/var/lib/docker|1038baec] +job initserver()
[/var/lib/docker|1038baec.initserver()] Creating server
mkdir /var/lib/docker/containers: permission denied[/var/lib/docker|1038baec] -job initserver() = ERR (1)
2014/02/21 09:53:09 initserver: mkdir /var/lib/docker/containers: permission denied
Command failed:
ERROR: Command '['docker', '-d']' returned non-zero exit status 1
ATTENTION: Special added info bla bla
workerm@notebook:~$

```

https://github.com/subuser-security/subuser/issues/8
ADDED: utils.getUserCommandLine

this will help to solve some of #8

used code for install

```
commandOptionList = ['--from-cache']
userProgramList, userOptionList = subuserlib.utils.getUserCommandLine(sys.argv[1:], commandOptionList)
print('userProgramList: ', userProgramList)
print('userOptionList: ', userOptionList)
```

outputs: multiple programs called with option

```
workerm@notebook:~$ subuser install vim firefox --from-cache
('userProgramList: ', ['vim', 'firefox'])
('userOptionList: ', ['--from-cache'])
workerm@notebook:~$

```

option are not confined anymore to any specific order in the commandline arguments

```
workerm@notebook:~$ subuser install --from-cache vim firefox
('userProgramList: ', ['vim', 'firefox'])
('userOptionList: ', ['--from-cache'])
workerm@notebook:~$
```

wrong program

```
subuser install libx11 --from-cache vim firefox wrongprogram
not an available subuser-program

Available programs are:
docker-in-docker
elm-get-git-dev
elm-git-dev
emacs
firefox
firefox-flash
firefox-java
firefox_libx11_libubuntu_precise
git
irssi
libelm-platform-git-dev
libhaskell-platform
libreoffice
libubuntu_precise
libx11
libx11_libubuntu_precise
skype
vim
xterm

workerm@notebook:~$
```