# Add \-\-add/\-\-new to control CLI behaviour \(\#9202\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/05dfe96f0c6471e8c4e6d8b7bda3ad70cf868d61)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 05dfe96f0c6471e8c4e6d8b7bda3ad70cf868d61

Requested commit: 05dfe96f0c6471e8c4e6d8b7bda3ad70cf868d61

Commit: 05dfe96f0c6471e8c4e6d8b7bda3ad70cf868d61

Tree: 556ec679cc97a04d7a8c7e16871a0bb3d5f2491b

Author: Conrad Irwin

Committer: GitHub

## Message

```
Add --add/--new to control CLI behaviour (#9202)

When neither is specified, if you open a directory you get a new
workspace, otherwise files are added to your existing workspace.

With --new files are always opened in a new workspace
With --add directories are always added to an existing workspace

Fixes #9076
Fixes #4861
Fixes #5370

Release Notes:

- Added `-n/--new` and `-a/--add` to the zed CLI. When neither is
specified, if you open a directory you get a new workspace, otherwise
files are added to your existing workspace. With `--new` files are
always opened in a new workspace, with `--add` directories are always
added to an existing workspace.
([#9076](https://github.com/zed-industries/zed/issues/9096),
[#4861](https://github.com/zed-industries/zed/issues/4861),
[#5370](https://github.com/zed-industries/zed/issues/5370)).
```

## Parents

- [89c67fb1aba178cffd62c44b2bcae6c6b9ff07a0](https://git.cafe/gitcafe/zed/commit/89c67fb1aba178cffd62c44b2bcae6c6b9ff07a0?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/05dfe96f0c6471e8c4e6d8b7bda3ad70cf868d61?format=markdown)
