@cli.command(name='<STR_LIT>',<EOL>short_help="<STR_LIT>"<EOL>"<STR_LIT>")<EOL>@click.option('<STR_LIT>', '<STR_LIT>', '<STR_LIT>', is_flag=True,<EOL>help="<STR_LIT>")<EOL>@click.pass_context<EOL>def clean_aliases(ctx, force_yes):
inactive_aliases = []<EOL>for (alias, mapping) in six.iteritems(aliases_database):<EOL><INDENT>if mapping.mapping is None:<EOL><INDENT>continue<EOL><DEDENT>project = ctx.obj['<STR_LIT>'].get(mapping.mapping[<NUM_LIT:0>],<EOL>mapping.backend)<EOL>if (project is None or not project.is_active() or<EOL>(mapping.mapping[<NUM_LIT:1>] is not None<EOL>and project.get_activity(mapping.mapping[<NUM_LIT:1>]) is None)):<EOL><INDENT>inactive_aliases.append(((alias, mapping), project))<EOL><DEDENT><DEDENT>if not inactive_aliases:<EOL><INDENT>ctx.obj['<STR_LIT>'].msg("<STR_LIT>")<EOL>return<EOL><DEDENT>if not force_yes:<EOL><INDENT>confirm = ctx.obj['<STR_LIT>'].clean_inactive_aliases(inactive_aliases)<EOL><DEDENT>if force_yes or confirm:<EOL><INDENT>ctx.obj['<STR_LIT>'].remove_aliases(<EOL>[item[<NUM_LIT:0>] for item in inactive_aliases]<EOL>)<EOL>ctx.obj['<STR_LIT>'].write_config()<EOL>ctx.obj['<STR_LIT>'].msg("<STR_LIT>"<EOL>"<STR_LIT>" % len(inactive_aliases))<EOL><DEDENT>
Removes aliases from your config file that point to inactive projects.