baude/docker-utils — pull request #16 by scollier (2014-11-05 02:35:53+00:00)
Title: handle -d arguments

This patch handles: "y", "ye", "yes", "Y", "Ye", "Yes" for yes, and exits on anything else.

Testing:

$ ./docker-dash.py -d
Delete all images and containers? Yes / No: no
Exiting now.

$ ./docker-dash.py -d
Delete all images and containers? Yes / No: No
Exiting now.

$ ./docker-dash.py -d
Delete all images and containers? Yes / No: asdf
Exiting now.

$ ./docker-dash.py -d
Delete all images and containers? Yes / No: y
Deleting containers...
Deleting images...
Deleting 511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158

$ ./docker-dash.py -d
Delete all images and containers? Yes / No: ye
Deleting containers...
Deleting images...
Deleting 511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158

$ ./docker-dash.py -d
Delete all images and containers? Yes / No: yes
Deleting containers...
Deleting images...
Deleting 511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158

$ ./docker-dash.py -d
Delete all images and containers? Yes / No: Y
Deleting containers...
Deleting images...
Deleting 511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158

$ ./docker-dash.py -d
Delete all images and containers? Yes / No: Ye
Deleting containers...
Deleting images...
Deleting 511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158

$ ./docker-dash.py -d
Delete all images and containers? Yes / No: Yes
Deleting containers...
Deleting images...
Deleting 511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158