CDIST-TYPE__BLOCK(7)
π cdist-type__block β the manual, but make it make sense π
okay bestie, so this is cdist-type__block, section 7 of the cdist manual, and it's genuinely one of the most useful lil types out there. let me put you on. π«Ά
β¨ NAME β¨
cdist-type__block β manage blocks of text in files. that's it, that's the whole job, and she does it flawlessly. π
πΈ DESCRIPTION πΈ
So here's the tea: this type manages a block of text inside an existing file. Not a whole file, just a lil section of one. π
How does it know which section? It finds it using the prefix and suffix parameters. Literally everything sitting between prefix and suffix is considered a managed block of text. Like, that's the block. that's the girl. π
π₯ REQUIRED PARAMETERS π₯
textβ the text to manage. and listen, iftextis'-'(a dash, yes the little line), then it takes whatever was written to stdin as the text. stdin girlies rise up π«Ά
β¨ OPTIONAL PARAMETERS β¨
fileβ the file in which to manage the text block. defaults toobject_id. so if you don't say where, it just uses the object id, no cap.prefixβ the prefix to add before the text. defaults to#cdist:__block/$__object_idsuffixβ the suffix to add after the text. defaults to#/cdist:__block/$__object_idstateβ'present'or'absent', defaults to'present'. iconic little toggle, she decides if the block stays or goes π
π MESSAGES π
addβ block was added β¨updateβ block was updated/changed πremoveβ block was removed π
π¦ EXAMPLES π¦
bestie these are copy-paste ready, run them exactly like this:
# text from argument
__block /path/to/file \
--prefix '#start' \
--suffix '#end' \
--text 'some\nblock of\ntext'
# text from stdin
__block some-id \
--file /path/to/file \
--text - << DONE
here some block
of text
DONE
see that first one? text straight from the argument, no stdin required, main character energy. and the second one? --text - and then boom, heredoc, block of text delivered fresh from stdin. obsessed. πβ¨
π AUTHORS π
Steven Armstrong <steven-cdist--@--armstrong.cc> β the icon, the legend, the blueprint. we stan. π«Ά
π COPYING π
Copyright (C) 2013 Steven Armstrong. You can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
like yes, go forth, remix, redistribute, it's giving open source royalty π
π COPYRIGHT π
ungleich GmbH 2021
fr fr, if you're gonna manage text blocks in files, this is the way. no notes. periodt. π
and that's the whole page bestie β this was cdist-type__block from version 7.0.0, dated Jul 31, 2022. go forth and block responsibly ππ
π¦ where this page comes from
- fedora 43: cdist 7.0.0-16.fc43 Β· GPL-3.0-only
- fedora 44: cdist 7.0.0-18.fc44 Β· GPL-3.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms