Fixed [ grep foo bar ] warning not working
This commit is contained in:
parent
97e886e6dd
commit
947ae519a2
|
@ -146,10 +146,11 @@ acceptButWarn parser level note = do
|
|||
)
|
||||
|
||||
|
||||
prop_readConditionContents = isWarning readCondition "[ grep -q file dir ]"
|
||||
readConditionContents single = do
|
||||
readCondOr `attempting` (lookAhead $ do
|
||||
pos <- getPosition
|
||||
choice (map string commonCommands)
|
||||
choice (map (try . string) commonCommands)
|
||||
parseProblemAt pos WarningC "To check a command, skip [] and just do 'if foo | grep bar; then'.")
|
||||
|
||||
where
|
||||
|
@ -264,7 +265,6 @@ readConditionContents single = do
|
|||
readCondOr = chainl1 readCondAnd readCondAndOp
|
||||
readCondAnd = chainl1 readCondTerm readCondOrOp
|
||||
|
||||
commonCommands :: [String]
|
||||
commonCommands = [ "bash", "bunzip2", "busybox", "bzcat", "bzcmp", "bzdiff", "bzegrep", "bzexe", "bzfgrep", "bzgrep", "bzip2", "bzip2recover", "bzless", "bzmore", "cat", "chacl", "chgrp", "chmod", "chown", "cp", "cpio", "dash", "date", "dd", "df", "dir", "dmesg", "dnsdomainname", "domainname", "echo", "ed", "egrep", "false", "fgconsole", "fgrep", "fuser", "getfacl", "grep", "gunzip", "gzexe", "gzip", "hostname", "ip", "kill", "ksh", "ksh93", "less", "lessecho", "lessfile", "lesskey", "lesspipe", "ln", "loadkeys", "login", "ls", "lsmod", "mkdir", "mknod", "mktemp", "more", "mount", "mountpoint", "mt", "mt-gnu", "mv", "nano", "nc", "nc.traditional", "netcat", "netstat", "nisdomainname", "noshell", "pidof", "ping", "ping6", "ps", "pwd", "rbash", "readlink", "rm", "rmdir", "rnano", "run-parts", "sed", "setfacl", "sh", "sh.distrib", "sleep", "stty", "su", "sync", "tailf", "tar", "tempfile", "touch", "true", "umount", "uname", "uncompress", "vdir", "which", "ypdomainname", "zcat", "zcmp", "zdiff", "zegrep", "zfgrep", "zforce", "zgrep", "zless", "zmore", "znew" ]
|
||||
|
||||
readCondition = do
|
||||
|
|
Loading…
Reference in New Issue