diff options
Diffstat (limited to 'main.py')
| -rwxr-xr-x | main.py | 7 |
1 files changed, 7 insertions, 0 deletions
| @@ -118,6 +118,10 @@ global_options.add_option('--time', | |||
| 118 | global_options.add_option('--version', | 118 | global_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') |
| 121 | global_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') | ||
| 121 | global_options.add_option('--event-log', | 125 | global_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) |
