|
13 | 13 | import typing as t |
14 | 14 |
|
15 | 15 | from vcspull._internal.config_reader import ConfigReader |
| 16 | +from vcspull._internal.config_style import format_repo_entry |
16 | 17 | from vcspull._internal.private_path import PrivatePath |
17 | 18 | from vcspull._internal.remotes import ( |
18 | 19 | AuthenticationError, |
|
25 | 26 | RemoteRepo, |
26 | 27 | ServiceUnavailableError, |
27 | 28 | ) |
| 29 | +from vcspull._internal.settings import resolve_style |
28 | 30 | from vcspull.config import ( |
29 | 31 | find_home_config_files, |
30 | 32 | save_config_json, |
@@ -162,6 +164,13 @@ def _create_shared_parent() -> argparse.ArgumentParser: |
162 | 164 | default="auto", |
163 | 165 | help="When to use colors (default: auto)", |
164 | 166 | ) |
| 167 | + output_group.add_argument( |
| 168 | + "--style", |
| 169 | + dest="style", |
| 170 | + choices=["concise", "standard", "verbose"], |
| 171 | + default=None, |
| 172 | + help="Config entry style (concise, standard, verbose)", |
| 173 | + ) |
165 | 174 | return parent |
166 | 175 |
|
167 | 176 |
|
@@ -281,6 +290,7 @@ def _run_import( |
281 | 290 | color: str, |
282 | 291 | use_https: bool = False, |
283 | 292 | flatten_groups: bool = False, |
| 293 | + style: str | None = None, |
284 | 294 | ) -> int: |
285 | 295 | """Run the import workflow for a single service. |
286 | 296 |
|
@@ -603,9 +613,10 @@ def _run_import( |
603 | 613 | skipped_count += 1 |
604 | 614 | continue |
605 | 615 |
|
606 | | - raw_config[repo_workspace_label][repo.name] = { |
607 | | - "repo": repo.to_vcspull_url(use_ssh=not use_https), |
608 | | - } |
| 616 | + resolved_style = resolve_style(style) |
| 617 | + raw_config[repo_workspace_label][repo.name] = format_repo_entry( |
| 618 | + repo.to_vcspull_url(use_ssh=not use_https), style=resolved_style |
| 619 | + ) |
609 | 620 | added_count += 1 |
610 | 621 |
|
611 | 622 | if error_labels: |
|
0 commit comments