You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
my co-worker noted that its hard to share pastes of the replace commands dry-run output because its colorized. supporting a two-line output of changes with +/- prefixed to denote addition and subtraction for each change is better formatted for sharing.
```
➜ build/vsh_darwin_amd64 -c 'replace -k value myValue KV1/src/a/foo -n'
/KV1/src/a/foo> vmyValue = 1
Skipping write.
➜ build/vsh_darwin_amd64 -c 'replace -k value myValue KV1/src/a/foo -n -o diff'
- /KV1/src/a/foo> value = 1
+ /KV1/src/a/foo> myValue = 1
Skipping write.
```
Copy file name to clipboardExpand all lines: CHANGELOG.md
+4
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,10 @@
2
2
3
3
## master - unreleased
4
4
5
+
ENHANCEMENTS:
6
+
7
+
* Add `--output` flag to `replace` command to output as line diffs for each replacement in addition to the default inline format. ([#88](https://github.com/fishi0x01/vsh/pull/88))
8
+
5
9
BUG FIXES:
6
10
7
11
* Don't show error on empty line enter in interactive mode ([#85](https://github.com/fishi0x01/vsh/pull/85))
`replace` works similarly to `grep`, but has the ability to mutate data inside Vault. By default, confirmation is required before writing data. You may skip confirmation by using the `-y`/`--confirm` flags. Conversely, you may use the `-n`/`--dry-run` flags to skip both confirmation and any writes. Changes that would be made are presented in red (delete) and green (add) coloring.
4
+
5
+
This command has two output formats available via the `--output` flag:
6
+
-`inline`: A colorized inline format where deletions are in red background text and additions are in green background text. This is the default.
7
+
-`diff`: A non-colorized format that prints changes in two lines prefixed with a `-` for before and `+` for after replacement. This is more useful for copying and pasting the result.
0 commit comments