diff options
author | Shawn O. Pearce <sop@google.com> | 2009-03-09 18:26:31 -0700 |
---|---|---|
committer | Shawn O. Pearce <sop@google.com> | 2009-03-09 18:26:31 -0700 |
commit | 0ed2bd1d95fb85dac1721f4c71abc8e07ec30e64 (patch) | |
tree | d6ac77f59b42c493f92156d697e56d481d8c6cae | |
parent | c7a4eefa7e775b64916a66b52ca6c5f31e2cf5c8 (diff) | |
download | git-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>
-rwxr-xr-x | main.py | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -27,6 +27,7 @@ import os | |||
27 | import re | 27 | import re |
28 | import sys | 28 | import sys |
29 | 29 | ||
30 | import git_command | ||
30 | from command import InteractiveCommand | 31 | from command import InteractiveCommand |
31 | from command import MirrorSafeCommand | 32 | from command import MirrorSafeCommand |
32 | from command import PagedCommand | 33 | from command import PagedCommand |
@@ -48,6 +49,9 @@ global_options.add_option('-p', '--paginate', | |||
48 | global_options.add_option('--no-pager', | 49 | global_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') |
52 | global_options.add_option('--trace', | ||
53 | dest='trace', action='store_true', | ||
54 | help='trace git command execution') | ||
51 | global_options.add_option('--version', | 55 | global_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' |