summaryrefslogtreecommitdiffstats
path: root/main.py
diff options
context:
space:
mode:
authorShawn O. Pearce <sop@google.com>2009-03-09 18:26:31 -0700
committerShawn O. Pearce <sop@google.com>2009-03-09 18:26:31 -0700
commit0ed2bd1d95fb85dac1721f4c71abc8e07ec30e64 (patch)
treed6ac77f59b42c493f92156d697e56d481d8c6cae /main.py
parentc7a4eefa7e775b64916a66b52ca6c5f31e2cf5c8 (diff)
downloadgit-repo-0ed2bd1d95fb85dac1721f4c71abc8e07ec30e64.tar.gz
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>
Diffstat (limited to 'main.py')
-rwxr-xr-xmain.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/main.py b/main.py
index 0e0a61de..df181835 100755
--- a/main.py
+++ b/main.py
@@ -27,6 +27,7 @@ import os
27import re 27import re
28import sys 28import sys
29 29
30import git_command
30from command import InteractiveCommand 31from command import InteractiveCommand
31from command import MirrorSafeCommand 32from command import MirrorSafeCommand
32from command import PagedCommand 33from command import PagedCommand
@@ -48,6 +49,9 @@ global_options.add_option('-p', '--paginate',
48global_options.add_option('--no-pager', 49global_options.add_option('--no-pager',
49 dest='no_pager', action='store_true', 50 dest='no_pager', action='store_true',
50 help='disable the pager') 51 help='disable the pager')
52global_options.add_option('--trace',
53 dest='trace', action='store_true',
54 help='trace git command execution')
51global_options.add_option('--version', 55global_options.add_option('--version',
52 dest='show_version', action='store_true', 56 dest='show_version', action='store_true',
53 help='display this version of repo') 57 help='display this version of repo')
@@ -74,6 +78,8 @@ class _Repo(object):
74 argv = [] 78 argv = []
75 gopts, gargs = global_options.parse_args(glob) 79 gopts, gargs = global_options.parse_args(glob)
76 80
81 if gopts.trace:
82 git_command.TRACE = True
77 if gopts.show_version: 83 if gopts.show_version:
78 if name == 'help': 84 if name == 'help':
79 name = 'version' 85 name = 'version'