@module.command()<EOL>@click.argument('<STR_LIT:name>', required=False)<EOL>@click.argument('<STR_LIT:path>', required=False)<EOL>@click.option('<STR_LIT>', help='<STR_LIT>')<EOL>@click.option(<EOL>'<STR_LIT>',<EOL>help='<STR_LIT>',<EOL>type=click.Choice(['<STR_LIT>', '<STR_LIT>']),<EOL>default='<STR_LIT>',<EOL>show_default=True)<EOL>def add(name, path, branch, type):
if not name and not path:<EOL><INDENT>ctx = click.get_current_context()<EOL>click.echo(ctx.get_help())<EOL>examples = (<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'<EOL>)<EOL>click.echo(examples)<EOL>return<EOL><DEDENT>if not name:<EOL><INDENT>click.echo('<STR_LIT>')<EOL>return<EOL><DEDENT>if not path:<EOL><INDENT>click.echo('<STR_LIT>')<EOL><DEDENT>env = cpenv.get_active_env()<EOL>if type=='<STR_LIT>':<EOL><INDENT>if not env:<EOL><INDENT>click.echo('<STR_LIT>')<EOL>return<EOL><DEDENT>if click.confirm('<STR_LIT>'.format(name, env.name)):<EOL><INDENT>click.echo('<STR_LIT>', nl=False)<EOL>try:<EOL><INDENT>env.add_module(name, path, branch)<EOL><DEDENT>except:<EOL><INDENT>click.echo(bold_red('<STR_LIT>'))<EOL>raise<EOL><DEDENT>else:<EOL><INDENT>click.echo(bold_green('<STR_LIT>'))<EOL><DEDENT><DEDENT>return<EOL><DEDENT>module_paths = cpenv.get_module_paths()<EOL>click.echo('<STR_LIT>')<EOL>for i, mod_path in enumerate(module_paths):<EOL><INDENT>click.echo('<STR_LIT>'.format(i, mod_path))<EOL><DEDENT>choice = click.prompt(<EOL>'<STR_LIT>',<EOL>type=int,<EOL>default=<NUM_LIT:0><EOL>)<EOL>module_root = module_paths[choice]<EOL>module_path = utils.unipath(module_root, name)<EOL>click.echo('<STR_LIT>'.format(module_path), nl=False)<EOL>try:<EOL><INDENT>cpenv.create_module(module_path, path, branch)<EOL><DEDENT>except:<EOL><INDENT>click.echo(bold_red('<STR_LIT>'))<EOL>raise<EOL><DEDENT>else:<EOL><INDENT>click.echo(bold_green('<STR_LIT>'))<EOL><DEDENT>
Add a module to an environment. PATH can be a git repository path or
    a filesystem path.