GitXplorerGitXplorer
j

cachedir

public
5 stars
1 forks
0 issues

Commits

List of commits on branch master.
Verified
cd27aaa17a11a803e9e8d15dff37b7d662697ece

Fix comment for `is_tagged` (#3)

KKinrany committed 4 years ago
Unverified
d959ef0b7615573c0fa414ac54c70a3dfa33f8b3

Add an import where it belongs

jjstasiak committed 4 years ago
Unverified
ece593d0362b117ce52c01dee5c158f5dfa71bb6

Bump version to 0.3.0 in preparation for a release

jjstasiak committed 4 years ago
Unverified
ccef8472b991e868e52c4dc2e831e0a008a31ca0

Remove an unused import

jjstasiak committed 4 years ago
Verified
0ce9c52eb7bc69aa6cb707e97cef1dcae2c09230

Document the CLI tool in the README

jjstasiak committed 4 years ago
Verified
4629045624a8acd3dd2820ed799c38336b88805e

Implement a CLI application with a first command (#2)

jjstasiak committed 4 years ago

README

The README file for this repository.

cachedir

crates.io CI codecov

A Rust library and a CLI tool to help interacting with cache directories and CACHEDIR.TAG files as defined in Cache Directory Tagging Specification.

You can find the library documentation on docs.rs.

To install the CLI tool run cargo install cachedir. To see what options are available run cachedir --help. Only one subcommand, is-tagged, is implemented right now. It allows checking if a directory is tagged with CACHEDIR.TAG (prints the relevant information to stderr and sets an appropriate exit-code: 0 for true, 1 for false, 2 for an error):

~/projects/cachedir% ls -lah target 
total 16
drwxr-xr-x@  6 user  staff   192B Dec 10 17:02 ./
drwxr-xr-x  10 user  staff   320B Dec 10 17:16 ../
-rw-r--r--   1 user  staff   1.4K Dec 12 21:52 .rustc_info.json
-rw-r--r--   1 user  staff   177B Dec 10 15:52 CACHEDIR.TAG
drwxr-xr-x  13 user  staff   416B Dec 12 21:47 debug/
drwxr-xr-x@  5 user  staff   160B Dec 10 17:02 rls/

~/projects/cachedir% cat target/CACHEDIR.TAG 
Signature: 8a477f597d28d172789f06886806bc55
# This file is a cache directory tag created by cargo.
# For information about cache directory tags see https://bford.info/cachedir/


~/projects/cachedir% cachedir is-tagged does-not-exist
No such file or directory (os error 2)
% echo $?
2

~/projects/cachedir% cachedir is-tagged .             
. is not tagged with CACHEDIR.TAG
~/projects/cachedir% echo $?                                 
1

~/projects/cachedir% cachedir is-tagged target
target is tagged with CACHEDIR.TAG
~/projects/cachedir% echo $?
0

Versions 0.1.0 and 0.1.1 of this crate on crates.io are actually distributions of a different, abandonded project by Lilian Anatolie Moraru. Credits to Lilian for transferring the name to me.