1 parent d9593c7 commit dc6a42bCopy full SHA for dc6a42b
1 file changed
src/Niv/Cli.hs
@@ -386,11 +386,11 @@ filterPackages :: Sources -> Maybe PackagePattern -> Sources
386
filterPackages (unSources -> sources) mPat = Sources $ case mPat of
387
-- no pattern: return all packages
388
Nothing -> sources
389
- -- pattern (filter) provided: match exact
+ -- pattern (filter) provided: return an exact match; if no exact match, match by prefix
390
Just (PackagePattern pat) -> case HMS.lookup (PackageName pat) sources of
391
Just exact -> HMS.singleton (PackageName pat) exact
392
Nothing ->
393
- HMS.filterWithKey (\k _ -> unPackageName k == pat) sources
+ HMS.filterWithKey (\k _ -> pat `T.isPrefixOf` (unPackageName k)) sources
394
395
parseCmdUpdate :: Opts.ParserInfo (NIO ())
396
parseCmdUpdate =
0 commit comments