--- a/lib/flaggie/action.py +++ a/lib/flaggie/action.py @@ -52,7 +52,7 @@ class Action(object): # Check whether the argument looks like a pattern but denote that # for keywords '**' and '*' have special meaning. - if (ns and 'kw' not in ns) or arg not in ('**', '*'): + if (ns and 'kw' not in ns) or arg not in ('**', '*', '~*'): for schr in ('*', '?', '['): if schr in arg: if not ns: --- a/lib/flaggie/cache.py +++ a/lib/flaggie/cache.py @@ -95,7 +95,7 @@ class Caches(object): kws = set() for r in self.dbapi.porttrees: kws.update(grabfile(os.path.join(r, 'profiles', 'arch.list'))) - kws.update(['~%s' % x for x in kws], ('*', '**')) + kws.update(['~%s' % x for x in kws], ('*', '**', '~*')) # and the ** special keyword self.cache[None] = frozenset(kws) --- a/lib/flaggie/cleanup.py +++ a/lib/flaggie/cleanup.py @@ -61,7 +61,7 @@ class DropUnmatchedFlags(BaseCleanupAction): if dbcache[pe.package]: flags = cache[pe.package] for flag in set([x.name for x in pe]): - if k == 'kw' and flag == '**': + if k == 'kw' and (flag == '**' or flag == '*' or flag == '~*'): pass elif flag not in flags: del pe[flag]