Open d-EScape opened 1 year ago
@d-EScape The wildcard addition is appreciated, though could you please review the conflicts here? I looked through to try and fix them myself, but not sure exactly how some of your "code cleanup" items will work with the most recent updates.
Thanks @demon! The regex approach in #57 looks much more elegant. It does however also export all networks when filtering on --all (e.g. ./autocompose.py -f "someprefix.*" -a). That is because of lines 120-122.
if args.all:
host_networks = generate_network_info()
networks = host_networks
Is there any reason for exporting unused networks in that case? If so, can you change this to
if args.all and not args.filter:
host_networks = generate_network_info()
networks = host_networks
For lack of a better name I called the option --wildcard (-w). It will select all containers that have the specified text in their names. Use case: easily create stack files to import in portainer. Example: I have renamed my domotica related containers to dom.domoticz, dom.mqtt, dom.zwave etc. I can create 1 stack file by doing a 'autocompose.py -w dom.'
output has been checked with docker-compose config