Skip to content

Commit 530360f

Browse files
committed
cli(import): drop legacy --dir aliases
1 parent 1ad8333 commit 530360f

6 files changed

Lines changed: 8 additions & 17 deletions

File tree

CHANGES

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ _Notes on upcoming releases will be added here_
2828
#### New command: `vcspull import` (#465)
2929

3030
- **Manual import**: Register a single repository with `vcspull import <name> <url>`
31-
- Optional `--workspace-root`/`--path` helpers for workspace-root detection (with legacy `--dir` alias)
31+
- Optional `--workspace-root`/`--path` helpers for workspace-root detection
3232
- **Filesystem scan**: Discover and import existing repositories with `vcspull import --scan <dir>`
3333
- Recursively scan with `--recursive`/`-r`
3434
- Interactive confirmation prompt or `--yes` for unattended runs
35-
- Custom workspace root with `--workspace-root` (legacy `--dir`/`--base-dir-key` aliases)
35+
- Custom workspace root with `--workspace-root`
3636

3737
#### New command: `vcspull fmt` (#465)
3838

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ $ vcspull import my-lib https://github.com/example/my-lib.git --path ~/code/my-l
101101

102102
- Omit `--path` to default the entry under `./`.
103103
- Use `--workspace-root` when you want to force a specific workspace root, e.g.
104-
`--workspace-root ~/projects/libs` (the legacy `--dir` alias still works).
104+
`--workspace-root ~/projects/libs`.
105105
- Pass `-c/--config` to import into an alternate YAML file.
106106
- Follow with `vcspull sync my-lib` to clone or update the working tree after registration.
107107

@@ -116,8 +116,7 @@ $ vcspull import --scan ~/code --recursive
116116

117117
The scan shows each repository before import unless you opt into `--yes`. Add
118118
`--workspace-root ~/code/` to pin the resulting workspace root or `--config` to
119-
write somewhere other than the default `~/.vcspull.yaml` (aliases `--dir` and
120-
`--base-dir-key` remain available for compatibility).
119+
write somewhere other than the default `~/.vcspull.yaml`.
121120

122121
### Normalize configuration files
123122

docs/cli/import.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@ $ vcspull import --scan ~/code --recursive
4949

5050
- `--recursive`/`-r` searches nested directories.
5151
- `--workspace-root` forces all discovered repositories to use the same
52-
workspace root, overriding the directory inferred from their location (the
53-
legacy `--dir` and `--base-dir-key` aliases still work).
52+
workspace root, overriding the directory inferred from their location.
5453
- `--yes`/`-y` accepts every suggestion, which is useful for unattended
5554
migrations.
5655

docs/quickstart.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,7 @@ YAML? Create a `~/.vcspull.yaml` file:
114114
Already have repositories cloned locally? Use
115115
`vcspull import --scan ~/code --recursive` to detect existing Git checkouts and
116116
append them to your configuration. See {ref}`cli-import` for more details and
117-
options such as `--workspace-root` and `--yes` for unattended runs (the legacy
118-
`--dir` and `--base-dir-key` aliases continue to work). After editing or
117+
options such as `--workspace-root` and `--yes` for unattended runs. After editing or
119118
importing, run `vcspull fmt --write` (documented in {ref}`cli-fmt`) to
120119
normalize keys and keep your configuration tidy.
121120

src/vcspull/cli/_import.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ def create_import_subparser(parser: argparse.ArgumentParser) -> None:
7979
)
8080
parser.add_argument(
8181
"--workspace-root",
82-
"--dir",
8382
dest="workspace_root_path",
8483
metavar="DIR",
8584
help=(
@@ -88,12 +87,6 @@ def create_import_subparser(parser: argparse.ArgumentParser) -> None:
8887
"When used with --scan, applies the workspace root to all discovered repos."
8988
),
9089
)
91-
parser.add_argument(
92-
"--base-dir-key",
93-
dest="workspace_root_path",
94-
metavar="DIR",
95-
help=argparse.SUPPRESS,
96-
)
9790

9891
# Filesystem scan mode
9992
parser.add_argument(

tests/cli/test_import.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ class ImportRepoFixture(t.NamedTuple):
145145
"import",
146146
"existing",
147147
"git@github.com:other/existing.git",
148-
"--dir",
148+
"--workspace-root",
149149
"~/code",
150150
],
151151
initial_config={
@@ -961,6 +961,7 @@ def test_import_command_help(
961961
assert "url" in output
962962
assert "--path" in output
963963
assert "--workspace-root" in output
964+
assert "--dir" not in output
964965
assert "--base-dir-key" not in output
965966
assert "--scan" in output
966967
assert "--config" in output

0 commit comments

Comments
 (0)