I've been playing with [Fabric](http://docs.fabfile.org/en/1.4.0/index.html). 

With a hello world program:

```
def hello(name="world"):
    print("hello %s!" % name)

if __name__ == '__main__':
    import sys
    from fabric.main import main
    sys.argv = ['fab', '-f', __file__,] + sys.argv[1:]
    main()

```

I can pass the argument `hello:name=quanta` and get the "hello quanta! result.

But with a below script:

```
from fabric.api import run

def hostname(host="localhost"):
    run("hostname")

if __name__ == '__main__':
    import sys
    from fabric.main import main
    sys.argv = ['fab', '-f', __file__,] + sys.argv[1:]
    main()

```

I got the errors:

> 
> Fatal error: Command(s) not found:
>  hostname
> 
> 
> Aborting.
> 
> 
> 

when passing `hostname:host=192.168.3.118` as a argument within PyDev.

It's working fine from the command line:

```
$ fab -f hostname.py hostname:host=192.168.3.118
[192.168.3.118] Executing task 'hostname'
[192.168.3.118] run: hostname
[192.168.3.118] out: SVR040-3118.localdomain
[192.168.3.118] out: 

Done.
Disconnecting from 192.168.3.118... done.

```

It's also happen with the `env` dictionary, something like this:

```
from fabric.api import run, env

env.hosts = ['192.168.3.118', '192.168.6.142']

def hostname():
    run("hostname")

if __name__ == '__main__':
    import sys
    from fabric.main import main
    sys.argv = ['fab', '-f', __file__,] + sys.argv[1:]
    main()

```

although running it from the command line gets the expected results:

```
$ fab -f hostname.py hostname
[192.168.3.118] Executing task 'hostname'
[192.168.3.118] run: hostname
[192.168.3.118] out: SVR040-3118.localdomain
[192.168.3.118] out: 
[192.168.6.142] Executing task 'hostname'
[192.168.6.142] run: hostname
[192.168.6.142] out: SVR040-6142
[192.168.6.142] out: 

Done.
Disconnecting from 192.168.6.142... done.
Disconnecting from 192.168.3.118... done.

```