diff options
-rwxr-xr-x | repo | 150 |
1 files changed, 68 insertions, 82 deletions
@@ -204,88 +204,73 @@ gpg_dir = os.path.join(home_dot_repo, 'gnupg') | |||
204 | extra_args = [] | 204 | extra_args = [] |
205 | init_optparse = optparse.OptionParser(usage="repo init -u url [options]") | 205 | init_optparse = optparse.OptionParser(usage="repo init -u url [options]") |
206 | 206 | ||
207 | # Logging | 207 | def _InitParser(): |
208 | group = init_optparse.add_option_group('Logging options') | 208 | """Setup the init subcommand parser.""" |
209 | group.add_option('-q', '--quiet', | 209 | # Logging. |
210 | dest="quiet", action="store_true", default=False, | 210 | group = init_optparse.add_option_group('Logging options') |
211 | help="be quiet") | 211 | group.add_option('-q', '--quiet', |
212 | 212 | action='store_true', default=False, | |
213 | # Manifest | 213 | help='be quiet') |
214 | group = init_optparse.add_option_group('Manifest options') | 214 | |
215 | group.add_option('-u', '--manifest-url', | 215 | # Manifest. |
216 | dest='manifest_url', | 216 | group = init_optparse.add_option_group('Manifest options') |
217 | help='manifest repository location', metavar='URL') | 217 | group.add_option('-u', '--manifest-url', |
218 | group.add_option('-b', '--manifest-branch', | 218 | help='manifest repository location', metavar='URL') |
219 | dest='manifest_branch', | 219 | group.add_option('-b', '--manifest-branch', |
220 | help='manifest branch or revision', metavar='REVISION') | 220 | help='manifest branch or revision', metavar='REVISION') |
221 | group.add_option('-m', '--manifest-name', | 221 | group.add_option('-m', '--manifest-name', |
222 | dest='manifest_name', | 222 | help='initial manifest file', metavar='NAME.xml') |
223 | help='initial manifest file', metavar='NAME.xml') | 223 | group.add_option('--current-branch', |
224 | group.add_option('--current-branch', | 224 | dest='current_branch_only', action='store_true', |
225 | dest='current_branch_only', action='store_true', | 225 | help='fetch only current manifest branch from server') |
226 | help='fetch only current manifest branch from server') | 226 | group.add_option('--mirror', action='store_true', |
227 | group.add_option('--mirror', | 227 | help='create a replica of the remote repositories ' |
228 | dest='mirror', action='store_true', | 228 | 'rather than a client working directory') |
229 | help='create a replica of the remote repositories ' | 229 | group.add_option('--reference', |
230 | 'rather than a client working directory') | 230 | help='location of mirror directory', metavar='DIR') |
231 | group.add_option('--reference', | 231 | group.add_option('--dissociate', action='store_true', |
232 | dest='reference', | 232 | help='dissociate from reference mirrors after clone') |
233 | help='location of mirror directory', metavar='DIR') | 233 | group.add_option('--depth', type='int', default=None, |
234 | group.add_option('--dissociate', | 234 | help='create a shallow clone with given depth; ' |
235 | dest='dissociate', action='store_true', | 235 | 'see git clone') |
236 | help='dissociate from reference mirrors after clone') | 236 | group.add_option('--partial-clone', action='store_true', |
237 | group.add_option('--depth', type='int', default=None, | 237 | help='perform partial clone (https://git-scm.com/' |
238 | dest='depth', | 238 | 'docs/gitrepository-layout#_code_partialclone_code)') |
239 | help='create a shallow clone with given depth; see git clone') | 239 | group.add_option('--clone-filter', action='store', default='blob:none', |
240 | group.add_option('--partial-clone', action='store_true', | 240 | help='filter for use with --partial-clone ' |
241 | dest='partial_clone', | 241 | '[default: %default]') |
242 | help='perform partial clone (https://git-scm.com/' | 242 | group.add_option('--archive', action='store_true', |
243 | 'docs/gitrepository-layout#_code_partialclone_code)') | 243 | help='checkout an archive instead of a git repository for ' |
244 | group.add_option('--clone-filter', action='store', default='blob:none', | 244 | 'each project. See git archive.') |
245 | dest='clone_filter', | 245 | group.add_option('--submodules', action='store_true', |
246 | help='filter for use with --partial-clone [default: %default]') | 246 | help='sync any submodules associated with the manifest repo') |
247 | group.add_option('--archive', | 247 | group.add_option('-g', '--groups', default='default', |
248 | dest='archive', action='store_true', | 248 | help='restrict manifest projects to ones with specified ' |
249 | help='checkout an archive instead of a git repository for ' | 249 | 'group(s) [default|all|G1,G2,G3|G4,-G5,-G6]', |
250 | 'each project. See git archive.') | 250 | metavar='GROUP') |
251 | group.add_option('--submodules', | 251 | group.add_option('-p', '--platform', default='auto', |
252 | dest='submodules', action='store_true', | 252 | help='restrict manifest projects to ones with a specified ' |
253 | help='sync any submodules associated with the manifest repo') | 253 | 'platform group [auto|all|none|linux|darwin|...]', |
254 | group.add_option('-g', '--groups', | 254 | metavar='PLATFORM') |
255 | dest='groups', default='default', | 255 | group.add_option('--no-clone-bundle', action='store_true', |
256 | help='restrict manifest projects to ones with specified ' | 256 | help='disable use of /clone.bundle on HTTP/HTTPS') |
257 | 'group(s) [default|all|G1,G2,G3|G4,-G5,-G6]', | 257 | group.add_option('--no-tags', action='store_true', |
258 | metavar='GROUP') | 258 | help="don't fetch tags in the manifest") |
259 | group.add_option('-p', '--platform', | 259 | |
260 | dest='platform', default="auto", | 260 | # Tool. |
261 | help='restrict manifest projects to ones with a specified ' | 261 | group = init_optparse.add_option_group('repo Version options') |
262 | 'platform group [auto|all|none|linux|darwin|...]', | 262 | group.add_option('--repo-url', metavar='URL', |
263 | metavar='PLATFORM') | 263 | help='repo repository location ($REPO_URL)') |
264 | group.add_option('--no-clone-bundle', | 264 | group.add_option('--repo-branch', metavar='REVISION', |
265 | dest='no_clone_bundle', action='store_true', | 265 | help='repo branch or revision ($REPO_REV)') |
266 | help='disable use of /clone.bundle on HTTP/HTTPS') | 266 | group.add_option('--no-repo-verify', action='store_true', |
267 | group.add_option('--no-tags', | 267 | help='do not verify repo source code') |
268 | dest='no_tags', action='store_true', | 268 | |
269 | help="don't fetch tags in the manifest") | 269 | # Other. |
270 | 270 | group = init_optparse.add_option_group('Other options') | |
271 | 271 | group.add_option('--config-name', | |
272 | # Tool | 272 | action='store_true', default=False, |
273 | group = init_optparse.add_option_group('repo Version options') | 273 | help='Always prompt for name/e-mail') |
274 | group.add_option('--repo-url', | ||
275 | dest='repo_url', | ||
276 | help='repo repository location ($REPO_URL)', metavar='URL') | ||
277 | group.add_option('--repo-branch', | ||
278 | dest='repo_branch', | ||
279 | help='repo branch or revision ($REPO_REV)', metavar='REVISION') | ||
280 | group.add_option('--no-repo-verify', | ||
281 | dest='no_repo_verify', action='store_true', | ||
282 | help='do not verify repo source code') | ||
283 | |||
284 | # Other | ||
285 | group = init_optparse.add_option_group('Other options') | ||
286 | group.add_option('--config-name', | ||
287 | dest='config_name', action="store_true", default=False, | ||
288 | help='Always prompt for name/e-mail') | ||
289 | 274 | ||
290 | 275 | ||
291 | def _GitcInitOptions(init_optparse_arg): | 276 | def _GitcInitOptions(init_optparse_arg): |
@@ -931,6 +916,7 @@ def main(orig_args): | |||
931 | 'command from the corresponding client under /gitc/', | 916 | 'command from the corresponding client under /gitc/', |
932 | file=sys.stderr) | 917 | file=sys.stderr) |
933 | sys.exit(1) | 918 | sys.exit(1) |
919 | _InitParser() | ||
934 | if not repo_main: | 920 | if not repo_main: |
935 | if opt.help: | 921 | if opt.help: |
936 | _Usage() | 922 | _Usage() |