Mast is a command-line utility for working with file MANIFESTS and DIGESTS. Mast can be used to create or update recursive directory listings, or compare manifests to actual directory contents. It can be useful in conjunction with packaging tools (such as Box), or as a stand-alone tool for monitoring file changes.
mast v1.4.0 Usage: mast [command] [options...] Examples: mast mast -u -f PUBLISH Commands: -c --create Generate a new manifest. (default) -u --update Update an existing manifest. -l --list List the files given in the manifest file. (Use -f to specify an alternate file.) -D --diff Diff manifest file against actual. -n --new List existent files that are not given in the manifest. -o --old List files given in the manifest but are non-existent. --clean Remove non-manifest files. (Will ask for confirmation first.) -v --verify Verify that a manifest matches actual. -r --recent Verify that a manifest is more recent than actual. -h --help Display this help message. Options: -a --all Include all files. This deactivates default exclusions so it is possible to make complete list of all contents. -d --dir When creating a list include directory paths; by default only files are listed. -s --show Show files using the options header in the manifest file. -f --file PATH Path to manifest file. When using update command, if not given then the file matching 'MANIFEST', case-insensitive and with an optional '.txt' extension, will be looked for in the current directory. If the path of the manifest file is anything else then --file option must be specified. -g --digest TYPE Include cryptographic signature. Type can be either md5, sha1, sha128, sha256, or sha512. -x --exclude PATH Exclude a file or dir from the manifest matching against full pathname. You can use --exclude repeatedly. -i --ignore PATH Exclude a file or dir from the manifest matching against an entry's basename. You can use --ignore repeatedly. --no-head Suppress mast header from output. -q --quiet Suppress extraneous output. --debug Run in debug mode.
Here is an example of a mast
generated MANIFEST file.
#!mast bin lib meta test [A-Z]* bin/mast lib/mast/cli.rb lib/mast/core_ext.rb lib/mast/manifest.rb lib/mast.rb meta/authors meta/contact meta/description meta/package meta/project meta/ruby meta/sitemap meta/version TUTORIAL.rdoc HISTORY.rdoc LICENSE README.rdoc
Notice the #!
header. That is how mast
can easily update a manifest at a
later time without the need to respecify all the options. Simply use the --update
or -u
option.
$ manifest -u MANIFEST updated.
When creating a manifest the --file
option can also be used to write the
output to a file instead of stdout. In the update example, mast automatically sets the
--file
option if a file in the working directory has a name matching "MANIFEST"
case-insensitive with optional .txt
extension; otherwise you can use the
--file
option to specify an alternate.
To create a DIGEST, rather than a MANIFEST, use the --digest
or -g
option.
#!mast -g sha1 bin lib meta test [A-Z]* f9f1afb9bfae1c9faedbea4a2c30259bf0f7aabc bin/mast da39a3ee5e6b4b0d3255bfef95601890afd80709 lib/mast bd2b091df1d3d4c0b53a1c77f4506043cfec1d98 lib/mast/cli.rb 7f58c6c9693b369a8b16d6cf1c33895683247c81 lib/mast/core_ext.rb 1d8a3a06419d7429d76a0abeb1e422ef77683cbc lib/mast/manifest.rb 6d5934bb71ac55c43c530e69be8cb67931225871 lib/mast.rb 8045a881b3310ff8a5f663a6e11278a8d304ce94 meta/authors 2d54dd0ad1e32d9a8c8d3c33aabae2f5f20dbee7 meta/contact 8f125e831ab047264ad2a0294480bd0a92ab8491 meta/description 16f24cd1ec2bc5b6ec6b2310f502983f106b824c meta/homepage 4983288cfc12926909557341e8e390bd5e862fb3 meta/namespace df70e594a5fbc0d55dc0fcfcb29a57503339b22a meta/package 7547afc4af34697b17e29117626a9a0488b8725f meta/repository 13319c0bd7a630388816acd412d676f40a92e883 meta/ruby 785ea838fe41924d61d12ffc5ac5a0132f7ae572 meta/sitemap c538b66c7110ca3a028ccfe422d0f1fa200a9935 meta/version dc6c400f4df68ad39c282026850fa44a65e4f7df TUTORIAL.rdoc b6c4ee33dfa1a541f180adfbfc0f71d4c9fa1019 HISTORY.rdoc ec16ef5152c62fac2c222d836e42b57360a5d805 LICENSE b325b103b3e51a52d78aa72eb6050160fe56ecfe README.rdoc
As you can see from the command-line help, mast
has a number of additional
commands and options. Try them out.
IMPORTANT! Be cautious with the --clean
command. This mode of operation will
delete any files in your directory not listed in the manifest. It will ask for confirmation before
proceeding however, so don't be too worried.
Copyright (c) 2009 Thomas Sawyer