e0a7dd7d919d

Add better error message for invalid types
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Sun, 02 Mar 2014 12:39:10 -0500
parents de2735512614
children f7ec69fb5eb5
branches/tags (none)
files ffind

Changes

--- a/ffind	Sat Nov 24 13:41:51 2012 -0500
+++ b/ffind	Sun Mar 02 12:39:10 2014 -0500
@@ -646,6 +646,19 @@
 
     result = set()
     for c in types:
+        if c not in 'aexcyfdrs':
+            die("invalid type specification\n\n"
+                "valid types:\n\n"
+                "  a (all)\n"
+                "  f (files)\n"
+                "  d (dirs)\n"
+                "  r (real)\n"
+                "  s (symlinked)\n"
+                "  e (real files)\n"
+                "  c (real dirs)\n"
+                "  x (symlinked files)\n"
+                "  y (symlinked dirs)")
+
         result = result | {
             'a': TYPES_ALL,