-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add output formatting option for replace command
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. ```
- Loading branch information
Matt Kulka
committed
Feb 22, 2021
1 parent
af2a284
commit c02d3aa
Showing
6 changed files
with
90 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
# replace | ||
|
||
`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. | ||
|
||
This command has two output formats available via the `--output` flag: | ||
- `inline`: A colorized inline format where deletions are in red background text and additions are in green background text. This is the default. | ||
- `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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters