Conversation
Allows specifying only the paths you want to parse in the repo
src/Semantic/CLI.hs
Outdated
| <|> ExcludeFromHandle <$> flag' stdin (long "exclude-stdin" <> help "Exclude paths given to stdin")) | ||
| <|> ExcludeFromHandle <$> flag' stdin (long "exclude-stdin" <> help "Exclude paths given to stdin") | ||
| <|> OnlyPaths <$> many (option str (long "only" <> help "Only include the specified paths")) | ||
| <|> OnlyPathsFromHandle <$> flag' stdin (long "only-stdin" <> help "Include only the paths given to stdin")) |
There was a problem hiding this comment.
The symmetry centre of my brain suggests: perhaps IncludePaths and IncludeFromHandle or IncludePathsFromHandle to mirror the exclude ones? I’m not super fussed, tho.
There was a problem hiding this comment.
I like that. I'm going to leave the command line switches because I think --only is a better description of the behavior, but I can rename the type constructors.
| , lang `elem` codeNavLanguages | ||
| , not (pathIsMinified path) | ||
| , path `notElem` excludePaths | ||
| , null includePaths || path `elem` includePaths |
There was a problem hiding this comment.
I have some mild discomfort around “what does it mean if we have the same path in both excludePaths and includePaths, and will this be surprising?” but since the CLI doesn’t allow you to specify both I think that’s ok 👍
There was a problem hiding this comment.
Ah yeah, if you call this function directly and pass the same path in both the excludes and includes list then excludes always win out. I think this might actually be fine/expected behavior.
Allows specifying only the paths you want to parse when reading from a git repo. This is the inverse of the existing args
--excludeand--exclude-stdin.