Expand description
Shell config block injection and path/value quoting.
BlockMarkers + the install_block_in_file / remove_block_from_file
functions handle adding and removing managed blocks from .bashrc,
.zshrc, SSH config, and similar files.
The quoting functions produce correctly-escaped strings for embedding paths and values into config files.
Structs§
- Block
Markers - Configuration for a managed block’s markers.
Enums§
- Block
Install Result - Result of an install/upsert operation.
- Block
Remove Result - Result of a removal operation.
Functions§
- build_
block - Build a complete block string from markers and body content.
- find_
block - Find the byte range of a managed block in the content.
- has_
block - Check whether a managed block is present.
- install_
block_ in_ file - Convenience: install or replace a managed block in a config file.
- quote_
config_ value - Quote a value for embedding in a config file.
- quote_
credential_ process_ arg - Quote a path for the
credential_processdirective in AWS config. - quote_
path_ for_ ssh_ config - Quote a filesystem path for embedding in an SSH-style config file.
- read_
config_ file - Read a file, normalize CRLF to LF, and return the content.
- remove_
block - Remove a managed block from the content.
- remove_
block_ from_ file - Convenience: remove a managed block from a config file.
- upsert_
block - Insert or replace a managed block in the content.
- write_
config_ file - Write a config file, creating parent directories if needed.