From 1f69a757ff649ee756589ffa463029f003b6e2c9 Mon Sep 17 00:00:00 2001 From: Haikel Guemar Date: Aug 06 2016 09:23:44 +0000 Subject: Add anonymous clone support using https Add -a/--anonymous option to clone command Fixes: #13 --- diff --git a/pag/commands/clone.py b/pag/commands/clone.py index dd29097..563e684 100644 --- a/pag/commands/clone.py +++ b/pag/commands/clone.py @@ -6,8 +6,11 @@ from pag.utils import ( run, ) + @app.command() @click.argument('name') -def clone(name): - url = repo_url(name, ssh=True, git=True) +@click.option('--anonymous', '-a', is_flag=True) +def clone(name, anonymous): + use_ssh = False if anonymous else True + url = repo_url(name, ssh=use_ssh, git=True) run(['git', 'clone', url, name.split('/')[-1]])