From 2772be44713650b56839cefaabf89edef0beede9 Mon Sep 17 00:00:00 2001 From: Lubomír Sedlář Date: Feb 03 2018 10:16:44 +0000 Subject: Add help for more commands --- diff --git a/pag/commands/clone.py b/pag/commands/clone.py index 563e684..37e55a0 100644 --- a/pag/commands/clone.py +++ b/pag/commands/clone.py @@ -11,6 +11,10 @@ from pag.utils import ( @click.argument('name') @click.option('--anonymous', '-a', is_flag=True) def clone(name, anonymous): + """ + Clone an existing repo. Use the '-a' option when you don't have commit + access to the repository. + """ use_ssh = False if anonymous else True url = repo_url(name, ssh=use_ssh, git=True) run(['git', 'clone', url, name.split('/')[-1]]) diff --git a/pag/commands/create.py b/pag/commands/create.py index a68b2b5..4dfcdd8 100644 --- a/pag/commands/create.py +++ b/pag/commands/create.py @@ -18,6 +18,10 @@ from pag.client import client @click.confirmation_option(prompt="Are you sure you want to create a new repo?") @configured def create(conf, name, description): + """ + Create a new repo. When run in an existing local git repository, this + command will also set up remotes. + """ click.echo("Trying to create %r in pagure.io" % name) if not client.is_logged_in: diff --git a/pag/commands/pullrequest.py b/pag/commands/pullrequest.py index b2677aa..6643a6c 100644 --- a/pag/commands/pullrequest.py +++ b/pag/commands/pullrequest.py @@ -35,10 +35,18 @@ def split_input(branch, default_repo): @app.command('pull-request') @assert_local_repo -@click.option('-b', '--base') +@click.option('-b', '--base', help='Branch to merge the changes in') @click.option('-h', '--head') @configured def pullrequest(conf, base, head): + """ + Open a new pull request. Default behaviour is to open pull request from + current branch to default upstream branch (usually 'master' or 'develop'). + + The '--head' option can be used to specify other branch than the current + one. You can open a pull request from a fork using + 'YOUR_USERNAME:BRANCH_NAME' as argument to '--head'. + """ name = in_git_repo() diff --git a/pag/commands/remote.py b/pag/commands/remote.py index 8a920b6..6a33051 100644 --- a/pag/commands/remote.py +++ b/pag/commands/remote.py @@ -14,11 +14,16 @@ from pag.utils import ( @app.group() @assert_local_repo def remote(): + """Create remote for another fork.""" pass @remote.command() @click.argument('name') def add(name): + """ + Given a username of owner of a fork of this repo, create a remote pointing + to that fork. + """ repo = in_git_repo() url = repo_url(name + '/' + repo) response = requests.head(url) diff --git a/pag/commands/upload.py b/pag/commands/upload.py index e12b3a0..7b4a834 100644 --- a/pag/commands/upload.py +++ b/pag/commands/upload.py @@ -18,6 +18,7 @@ from pag.client import client @configured @assert_local_repo def upload(conf, tarball): + """Upload new file to releases.""" name = in_git_repo() click.echo('Trying to upload %r' % tarball) if not client.is_logged_in: