diff options
Diffstat (limited to 'repo')
| -rwxr-xr-x | repo | 17 |
1 files changed, 15 insertions, 2 deletions
| @@ -214,6 +214,7 @@ group.add_option('--config-name', | |||
| 214 | help='Always prompt for name/e-mail') | 214 | help='Always prompt for name/e-mail') |
| 215 | 215 | ||
| 216 | def _GitcInitOptions(init_optparse): | 216 | def _GitcInitOptions(init_optparse): |
| 217 | init_optparse.set_usage("repo gitc-init -u url -c client [options]") | ||
| 217 | g = init_optparse.add_option_group('GITC options') | 218 | g = init_optparse.add_option_group('GITC options') |
| 218 | g.add_option('-f', '--manifest-file', | 219 | g.add_option('-f', '--manifest-file', |
| 219 | dest='manifest_file', | 220 | dest='manifest_file', |
| @@ -272,9 +273,12 @@ def _Init(args, gitc_init=False): | |||
| 272 | if gitc_init: | 273 | if gitc_init: |
| 273 | gitc_manifest_dir = get_gitc_manifest_dir() | 274 | gitc_manifest_dir = get_gitc_manifest_dir() |
| 274 | if not gitc_manifest_dir: | 275 | if not gitc_manifest_dir: |
| 275 | _print('error: GITC filesystem is not running. Exiting...', | 276 | _print('fatal: GITC filesystem is not available. Exiting...', |
| 276 | file=sys.stderr) | 277 | file=sys.stderr) |
| 277 | sys.exit(1) | 278 | sys.exit(1) |
| 279 | if not opt.gitc_client: | ||
| 280 | _print('fatal: GITC client (-c) is required.', file=sys.stderr) | ||
| 281 | sys.exit(1) | ||
| 278 | client_dir = os.path.join(gitc_manifest_dir, opt.gitc_client) | 282 | client_dir = os.path.join(gitc_manifest_dir, opt.gitc_client) |
| 279 | if not os.path.exists(client_dir): | 283 | if not os.path.exists(client_dir): |
| 280 | os.makedirs(client_dir) | 284 | os.makedirs(client_dir) |
| @@ -681,6 +685,10 @@ def _ParseArguments(args): | |||
| 681 | 685 | ||
| 682 | 686 | ||
| 683 | def _Usage(): | 687 | def _Usage(): |
| 688 | gitc_usage = "" | ||
| 689 | if get_gitc_manifest_dir(): | ||
| 690 | gitc_usage = " gitc-init Initialize a GITC Client.\n" | ||
| 691 | |||
| 684 | _print( | 692 | _print( |
| 685 | """usage: repo COMMAND [ARGS] | 693 | """usage: repo COMMAND [ARGS] |
| 686 | 694 | ||
| @@ -689,7 +697,8 @@ repo is not yet installed. Use "repo init" to install it here. | |||
| 689 | The most commonly used repo commands are: | 697 | The most commonly used repo commands are: |
| 690 | 698 | ||
| 691 | init Install repo in the current working directory | 699 | init Install repo in the current working directory |
| 692 | help Display detailed help on a command | 700 | """ + gitc_usage + |
| 701 | """ help Display detailed help on a command | ||
| 693 | 702 | ||
| 694 | For access to the full online help, install repo ("repo init"). | 703 | For access to the full online help, install repo ("repo init"). |
| 695 | """, file=sys.stderr) | 704 | """, file=sys.stderr) |
| @@ -701,6 +710,10 @@ def _Help(args): | |||
| 701 | if args[0] == 'init': | 710 | if args[0] == 'init': |
| 702 | init_optparse.print_help() | 711 | init_optparse.print_help() |
| 703 | sys.exit(0) | 712 | sys.exit(0) |
| 713 | elif args[0] == 'gitc-init': | ||
| 714 | _GitcInitOptions(init_optparse) | ||
| 715 | init_optparse.print_help() | ||
| 716 | sys.exit(0) | ||
| 704 | else: | 717 | else: |
| 705 | _print("error: '%s' is not a bootstrap command.\n" | 718 | _print("error: '%s' is not a bootstrap command.\n" |
| 706 | ' For access to online help, install repo ("repo init").' | 719 | ' For access to online help, install repo ("repo init").' |
