Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions autocompose.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#! /usr/bin/env python3
import argparse
import datetime
import re
import sys

from collections import OrderedDict
Expand Down Expand Up @@ -77,13 +78,23 @@ def main():
action="store_true",
help="Create new volumes instead of reusing existing ones",
)
parser.add_argument(
"-f",
"--filter",
type=str,
help="Filter containers by regex",
)
args = parser.parse_args()

container_names = args.cnames

if args.all:
container_names.extend(list_container_names())

if args.filter:
cfilter = re.compile(args.filter)
container_names = [c for c in container_names if cfilter.search(c)]

struct = {}
networks = {}
volumes = {}
Expand Down