Improve output when filtering devices

This commit is contained in:
Benjamin Renard 2023-12-19 13:50:32 +01:00
parent 6a75eb1abc
commit c3b64b767d

View file

@ -173,6 +173,10 @@ for folder in config["folders"]:
share_with = [ share_with = [
devices[dev["deviceID"]] for dev in folder["devices"] if dev["deviceID"] in devices devices[dev["deviceID"]] for dev in folder["devices"] if dev["deviceID"] in devices
] ]
if not share_with:
if args.devices or args.excluded_devices:
continue
share_with = ["no device"]
extra_lines.append( extra_lines.append(
f"- {folder['label']} ({folder['path']}, share with {', '.join(share_with)})" f"- {folder['label']} ({folder['path']}, share with {', '.join(share_with)})"
) )
@ -209,3 +213,5 @@ else:
print(" - ".join(status)) print(" - ".join(status))
print("\n".join(extra_lines)) print("\n".join(extra_lines))
sys.exit(exit_status[error_level]) sys.exit(exit_status[error_level])
# vim: tabstop=4 shiftwidth=4 softtabstop=4 expandtab