diff options
| author | Lorenz Leitner <lorenz.leitner@student.tugraz.at> | 2019-03-15 10:06:04 +0100 |
|---|---|---|
| committer | Lorenz Leitner <lorenz.leitner@student.tugraz.at> | 2019-03-15 10:06:04 +0100 |
| commit | 31f23088d70622ea5411e63a8449fc03dc0cade1 (patch) | |
| tree | 657ebdff820e34c2798ea33cb3eb08b3d87e0055 /pywal | |
| parent | 3a95122157071c44f521210858a5c6bacfe9c3bb (diff) | |
Add recursive argument to cli
Diffstat (limited to 'pywal')
| -rw-r--r-- | pywal/__main__.py | 8 | ||||
| -rw-r--r-- | pywal/image.py | 1 |
2 files changed, 7 insertions, 2 deletions
diff --git a/pywal/__main__.py b/pywal/__main__.py index 2e50ca9..b7a7aad 100644 --- a/pywal/__main__.py +++ b/pywal/__main__.py @@ -53,6 +53,11 @@ def get_args(): "flag is used: Go through the images in order " "instead of shuffled.") + arg.add_argument("--recursive", action="store_true", + help="When pywal is given a directory as input and this " + "flag is used: Search for images recursively in " + "subdirectories instead of the root only.") + arg.add_argument("--saturate", metavar="0.0-1.0", help="Set the color saturation.") @@ -159,7 +164,8 @@ def parse_args(parser): util.Color.alpha_num = args.a if args.i: - image_file = image.get(args.i, iterative=args.iterative) + image_file = image.get(args.i, iterative=args.iterative, + recursive=args.recursive) colors_plain = colors.get(image_file, args.l, args.backend, sat=args.saturate) diff --git a/pywal/image.py b/pywal/image.py index 71a12f0..8e55a7b 100644 --- a/pywal/image.py +++ b/pywal/image.py @@ -98,7 +98,6 @@ def get_next_image(img_dir, recursive): def get(img, cache_dir=CACHE_DIR, iterative=False, recursive=False): """Validate image input.""" - recursive = True # TODO: Remove if os.path.isfile(img): wal_img = img |
