diff --git a/subcmds/info.py b/subcmds/info.py index 6381fa8e..8e017ed8 100644 --- a/subcmds/info.py +++ b/subcmds/info.py @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +import optparse + from command import PagedCommand from color import Coloring from git_refs import R_M, R_HEADS @@ -25,7 +27,7 @@ class _Coloring(Coloring): class Info(PagedCommand): common = True helpSummary = "Get info on the manifest branch, current branch or unmerged branches" - helpUsage = "%prog [-dl] [-o [-b]] [...]" + helpUsage = "%prog [-dl] [-o [-c]] [...]" def _Options(self, p): p.add_option('-d', '--diff', @@ -34,9 +36,13 @@ class Info(PagedCommand): p.add_option('-o', '--overview', dest='overview', action='store_true', help='show overview of all local commits') - p.add_option('-b', '--current-branch', + p.add_option('-c', '--current-branch', dest="current_branch", action="store_true", help="consider only checked out branches") + # Turn this into a warning & remove this someday. + p.add_option('-b', + dest='current_branch', action='store_true', + help=optparse.SUPPRESS_HELP) p.add_option('-l', '--local-only', dest="local", action="store_true", help="Disable all remote operations") diff --git a/subcmds/overview.py b/subcmds/overview.py index 004a847c..4f62f94f 100644 --- a/subcmds/overview.py +++ b/subcmds/overview.py @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +import optparse + from color import Coloring from command import PagedCommand @@ -26,15 +28,19 @@ class Overview(PagedCommand): The '%prog' command is used to display an overview of the projects branches, and list any local commits that have not yet been merged into the project. -The -b/--current-branch option can be used to restrict the output to only +The -c/--current-branch option can be used to restrict the output to only branches currently checked out in each project. By default, all branches are displayed. """ def _Options(self, p): - p.add_option('-b', '--current-branch', + p.add_option('-c', '--current-branch', dest="current_branch", action="store_true", help="Consider only checked out branches") + # Turn this into a warning & remove this someday. + p.add_option('-b', + dest='current_branch', action='store_true', + help=optparse.SUPPRESS_HELP) def Execute(self, opt, args): all_branches = [] diff --git a/subcmds/upload.py b/subcmds/upload.py index 0dd0b7da..57434b18 100644 --- a/subcmds/upload.py +++ b/subcmds/upload.py @@ -14,6 +14,7 @@ import copy import functools +import optparse import re import sys @@ -170,9 +171,13 @@ Gerrit Code Review: https://www.gerritcodereview.com/ p.add_option('--br', '--branch', type='string', action='store', dest='branch', help='(Local) branch to upload.') - p.add_option('--cbr', '--current-branch', + p.add_option('-c', '--current-branch', dest='current_branch', action='store_true', help='Upload current git branch.') + # Turn this into a warning & remove this someday. + p.add_option('--cbr', + dest='current_branch', action='store_true', + help=optparse.SUPPRESS_HELP) p.add_option('--ne', '--no-emails', action='store_false', dest='notify', default=True, help='If specified, do not send emails on upload.')