mirror of
https://gerrit.googlesource.com/git-repo
synced 2024-12-21 07:16:21 +00:00
Add global --trace command line option
This has the same effect as saying "export REPO_TRACE=1" in your shell prior to starting repo, but is documented in the command usage and perhaps easier to use. Signed-off-by: Shawn O. Pearce <sop@google.com>
This commit is contained in:
parent
c7a4eefa7e
commit
0ed2bd1d95
6
main.py
6
main.py
@ -27,6 +27,7 @@ import os
|
|||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
import git_command
|
||||||
from command import InteractiveCommand
|
from command import InteractiveCommand
|
||||||
from command import MirrorSafeCommand
|
from command import MirrorSafeCommand
|
||||||
from command import PagedCommand
|
from command import PagedCommand
|
||||||
@ -48,6 +49,9 @@ global_options.add_option('-p', '--paginate',
|
|||||||
global_options.add_option('--no-pager',
|
global_options.add_option('--no-pager',
|
||||||
dest='no_pager', action='store_true',
|
dest='no_pager', action='store_true',
|
||||||
help='disable the pager')
|
help='disable the pager')
|
||||||
|
global_options.add_option('--trace',
|
||||||
|
dest='trace', action='store_true',
|
||||||
|
help='trace git command execution')
|
||||||
global_options.add_option('--version',
|
global_options.add_option('--version',
|
||||||
dest='show_version', action='store_true',
|
dest='show_version', action='store_true',
|
||||||
help='display this version of repo')
|
help='display this version of repo')
|
||||||
@ -74,6 +78,8 @@ class _Repo(object):
|
|||||||
argv = []
|
argv = []
|
||||||
gopts, gargs = global_options.parse_args(glob)
|
gopts, gargs = global_options.parse_args(glob)
|
||||||
|
|
||||||
|
if gopts.trace:
|
||||||
|
git_command.TRACE = True
|
||||||
if gopts.show_version:
|
if gopts.show_version:
|
||||||
if name == 'help':
|
if name == 'help':
|
||||||
name = 'version'
|
name = 'version'
|
||||||
|
Loading…
Reference in New Issue
Block a user