diff options
| -rwxr-xr-x | main.py | 7 | ||||
| -rw-r--r-- | man/repo.1 | 4 |
2 files changed, 11 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) |
| @@ -34,6 +34,10 @@ time repo command execution | |||
| 34 | \fB\-\-version\fR | 34 | \fB\-\-version\fR |
| 35 | display this version of repo | 35 | display this version of repo |
| 36 | .TP | 36 | .TP |
| 37 | \fB\-\-show\-toplevel\fR | ||
| 38 | display the path of the top\-level directory of the | ||
| 39 | repo client checkout | ||
| 40 | .TP | ||
| 37 | \fB\-\-event\-log\fR=\fI\,EVENT_LOG\/\fR | 41 | \fB\-\-event\-log\fR=\fI\,EVENT_LOG\/\fR |
| 38 | filename of event log to append timeline to | 42 | filename of event log to append timeline to |
| 39 | .TP | 43 | .TP |
