mattress 0.1.0

A command line tool for working with Linux extended attributes (xattrs)
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.txt
  • mtr mv -f id path1.txt path2.txt: move xattr id from path1.txt to path2.txt
  • mtr mv -f id -f url path1.txt path2.txt: move xattrs id and url from path1.txt to path2.txt
  • mtr cp path1.txt path2.txt: copy all xattrs from path1.txt to path2.txt
  • mtr cp -f id path1.txt path2.txt: copy xattr id from path1.txt to path2.txt
  • mtr cp -f id -f url path1.txt path2.txt: copy xattrs id and url from path1.txt to path2.txt
  • mtr rm path.txt: remove all xattrs on path.txt
  • mtr rm -f id path.txt: remove xattr id from path.txt
  • mtr rm -f id -f url path1.txt path2.txt path3.txt: remove xattrs id and url from path1.txt, path2.txt, and path3.txt
  • mtr set -s id=123 path1.txt: set xattr id to value 123 on path1.txt
  • mtr set -s id=123 -f url=http://example.com path1.txt path2.txt path3.txt: set xattr id to value 123 and xattr url to value http://example.com on path1.txt, path2.txt, and path3.txt
  • mtr get path1.txt: print all xattrs associated with path1.txt raw (undecoded) TSV
  • mtr get -f id path1.txt: print xattr id and its value on path1.txt as raw (undecoded) TSV
  • mtr get -f id -f url path1.txt path2.txt path3.txt: print xattrs id and url and their respective values on path1.txt, path2.txt, and path3.txt as raw (undecoded) TSV
  • mtr get -j path1.txt: print all xattrs associated with path1.txt as UTF-8 decoded JSON
  • mtr get -j -f id path1.txt: print xattr id and its value on path1.txt as UTF-8 decoded JSON
  • mtr get -j -f id -f url path1.txt path2.txt path3.txt: print xattrs id and url and their respective values on path1.txt, path2.txt, and path3.txt as JSON