mattress-0.1.0 is not a library.
Visit the last successful build:
mattress-0.2.1
Mattress: a command line tool for working with Linux extended attributes (xattrs)
The comfiest way to work with Linux extended attributes (xattrs) written in pure Rust and made of delicious, fibrous Open Source code.
Details
By default, the get subcommand outputs a tab-separated table with a column order of path, field, value. The value bytes are written to stdout as-is without decoding.
By contrast, when outputting JSON, Mattress attempts to decode values as UTF-8, filling in a default codepoint when the decoding fails.
History
Mattress was developed in conjunction with the Audiotater audio annotation tool.
License
This software is licensed under GPL version 3 only
Examples
mtr mv path1.txt path2.txt: move all xattrs from path1.txt to path2.txtmtr mv -f id path1.txt path2.txt: move xattridfrom path1.txt to path2.txtmtr mv -f id -f url path1.txt path2.txt: move xattrsidandurlfrom path1.txt to path2.txtmtr cp path1.txt path2.txt: copy all xattrs from path1.txt to path2.txtmtr cp -f id path1.txt path2.txt: copy xattridfrom path1.txt to path2.txtmtr cp -f id -f url path1.txt path2.txt: copy xattrsidandurlfrom path1.txt to path2.txtmtr rm path.txt: remove all xattrs on path.txtmtr rm -f id path.txt: remove xattridfrom path.txtmtr rm -f id -f url path1.txt path2.txt path3.txt: remove xattrsidandurlfrom path1.txt, path2.txt, and path3.txtmtr set -s id=123 path1.txt: set xattridto value123on path1.txtmtr set -s id=123 -f url=http://example.com path1.txt path2.txt path3.txt: set xattridto value123and xattrurlto valuehttp://example.comon path1.txt, path2.txt, and path3.txtmtr get path1.txt: print all xattrs associated with path1.txt raw (undecoded) TSVmtr get -f id path1.txt: print xattridand its value on path1.txt as raw (undecoded) TSVmtr get -f id -f url path1.txt path2.txt path3.txt: print xattrsidandurland their respective values on path1.txt, path2.txt, and path3.txt as raw (undecoded) TSVmtr get -j path1.txt: print all xattrs associated with path1.txt as UTF-8 decoded JSONmtr get -j -f id path1.txt: print xattridand its value on path1.txt as UTF-8 decoded JSONmtr get -j -f id -f url path1.txt path2.txt path3.txt: print xattrsidandurland their respective values on path1.txt, path2.txt, and path3.txt as JSON