Commits

Oben Sonne  committed d6d5863

List command optionally only shows one specific path

Still undocumented feature (i.e. not mentioned in help output),
primarily intended for scripting gnome-encfs.

Based on a patch by Sam Bull.

  • Participants
  • Parent commits 374c4b9

Comments (0)

Files changed (1)

 # actions
 # =============================================================================
 
-def list_items():
+def list_items(path=None):
     """List EncFS items in keyring."""
     
-    items = _get_items()
+    items = _get_items(anypath=path)
+
+    if not items and path:
+        print(MSG_NO_MATCH)
+        return False
+
     for item in items:
         epath = item.attributes["encfs-path"]
         mpoint = item.attributes["mount-point"]
     if opts.add:
         ok = add_item(opts.p1, opts.p2)
     elif opts.list:
-        ok = list_items()
+        ok = list_items(opts.p1)
     elif opts.mount:
         ok = mount_items(opts.p1, opts.autostart)
     elif opts.edit: