From b3c798033ce4e0dd46b5f6ef767ffdf6131163a3 Mon Sep 17 00:00:00 2001 From: Rhet Turnbull Date: Sat, 7 Dec 2019 07:21:23 -0800 Subject: [PATCH] Cleaned up logic in cmd_line query(). Closes #17 --- osxphotos/cmd_line.py | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/osxphotos/cmd_line.py b/osxphotos/cmd_line.py index 1d18e967..512ff7eb 100644 --- a/osxphotos/cmd_line.py +++ b/osxphotos/cmd_line.py @@ -194,21 +194,23 @@ def query( """ # if no query terms, show help and return - if ( - not keyword - and not person - and not album - and not uuid - and not name - and not no_name - and not description - and not no_description - and not favorite - and not not_favorite - and not hidden - and not not_hidden - and not missing - and not not_missing + if not any( + [ + keyword, + person, + album, + uuid, + name, + no_name, + description, + no_description, + favorite, + not_favorite, + hidden, + not_hidden, + missing, + not_missing, + ] ): print(cli.commands["query"].get_help(ctx)) return