Skip to main content

Command Line Flags

Because the usage of DotSlash is:

dotslash DOTSLASH_FILE [OPTIONS]

where [OPTIONS] is forwarded to the executable represented by DOTSLASH_FILE, DotSlash's own command line flags must be able to be disambiguated from DOTSLASH_FILE. In practice, that means any flag recognized by DotSlash is an unsupported DotSlash file name. For this reason, the set of supported flags is fairly limited.

Supported Flags

flagdescription
--helpprints basic usage info, as well as the platform it was compiled for (which is the entry it will use from the "platforms" map in a DotSlash file)
--versionprints the DotSlash version number and exits

Experimental Commands

Experimental commands are special flags that we are not committed to supporting, and whose output format should be considered unstable. These commands are "hidden" behind -- (using -- as the first argument to dotslash tells it to use a special argument parser) and are used like so:

$ dotslash -- cache-dir
/Users/mbolin/Library/Caches/dotslash
commanddescription
b3sum FILEprints the BLAKE3 hash of FILE
cache-dirprints the absolute path to the user's DotSlash cache and exits
create-url-entry URLgenerates the DotSlash JSON snippet for the artifact at the URL
fetch DOTSLASH_FILEfetches the artifact identified by DOTSLASH_FILE if it is not already in the cache
parse DOTSLASH_FILEparses DOTSLASH_FILE and prints the data as pure JSON to stdout
sha256 FILEprints the SHA-256 hash of FILE

Environment Variables

The DOTSLASH_CACHE environment variable can be used to override the default location of the DotSlash cache. By default, the DotSlash cache resides at:

platformpath
Linux$XDG_CACHE_HOME/dotslash or `$HOME/.cache/dotslash
macOS$HOME/Library/Caches/dotslash
Windows{FOLDERID_LocalAppData}/dotslash

DotSlash relies on dirs::cache_dir() to use the appropriate default directory on each platform.