summaryrefslogtreecommitdiffstats
path: root/main.py
diff options
context:
space:
mode:
Diffstat (limited to 'main.py')
-rwxr-xr-xmain.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/main.py b/main.py
index 229cb729..2050cabb 100755
--- a/main.py
+++ b/main.py
@@ -118,6 +118,10 @@ global_options.add_option('--time',
118global_options.add_option('--version', 118global_options.add_option('--version',
119 dest='show_version', action='store_true', 119 dest='show_version', action='store_true',
120 help='display this version of repo') 120 help='display this version of repo')
121global_options.add_option('--show-toplevel',
122 action='store_true',
123 help='display the path of the top-level directory of '
124 'the repo client checkout')
121global_options.add_option('--event-log', 125global_options.add_option('--event-log',
122 dest='event_log', action='store', 126 dest='event_log', action='store',
123 help='filename of event log to append timeline to') 127 help='filename of event log to append timeline to')
@@ -202,6 +206,9 @@ class _Repo(object):
202 elif gopts.show_version: 206 elif gopts.show_version:
203 # Always allow global --version regardless of subcommand validity. 207 # Always allow global --version regardless of subcommand validity.
204 name = 'version' 208 name = 'version'
209 elif gopts.show_toplevel:
210 print(os.path.dirname(self.repodir))
211 return 0
205 elif not name: 212 elif not name:
206 # No subcommand specified, so show the help/subcommand. 213 # No subcommand specified, so show the help/subcommand.
207 self._PrintHelp(short=True) 214 self._PrintHelp(short=True)