Nice feature, but has no tests. Please test it.

Also, why not use "ls -1" instead of this whole JSON packing and unpacking with Python? I think "ls -1" would lead you to a much simpler solution. (Please tell me if there's a reason not to do so, that I may not be seeing.)