id = "cargo"
name = "Cargo"
homepage = "https://doc.rust-lang.org/cargo/reference/config.html"
description = "Rust's package manager and build tool."
icon = "SimpleIcons:rust"
executables = ["cargo"]
[dotfiles]
paths = ["~/.cargo/config.toml", "~/.cargo/config"]
exclude = [
"~/.cargo/registry/",
"~/.cargo/git/",
"~/.cargo/bin/",
"~/.cargo/.package-cache",
"~/.cargo/.crates.toml",
"~/.cargo/.crates2.json",
]
secret = ["~/.cargo/credentials.toml", "~/.cargo/credentials"]
[[dotfiles.machine_lines]]
file = "~/.cargo/config.toml"
match = { key_path = ["paths", "build.target-dir"] }
scope = "backup"
[commands]
format = 1
label = "Cargo"
description = "Build, test, run and create Rust packages. Other cargo commands (publish, install, doc, clippy) are left out."
quality = "ai-draft"
base = "fig:cargo"
parser = { end_of_options = "--", interleave = "permute", long_equals = true, short_attached = true, short_bundles = false }
[[commands.source]]
id = "fig"
kind = "completion"
url = "https://github.com/withfig/autocomplete/blob/master/src/cargo.ts"
license = "MIT"
[[commands.subcommand]]
path = ["build"]
label = "Build a package"
description = "Compile a local package and its dependencies."
[[commands.subcommand.source]]
id = "fig"
kind = "completion"
url = "https://github.com/withfig/autocomplete/blob/master/src/cargo.ts"
license = "MIT"
[[commands.subcommand.field]]
id = "release"
label = "Release mode"
description = "Build artifacts in release mode, with optimizations."
type = "boolean"
option = ["--release", "-r"]
sources = ["fig"]
[[commands.subcommand.field]]
id = "package"
label = "Package"
description = "Package to build."
type = "string"
option = ["--package", "-p"]
sources = ["fig"]
[[commands.subcommand.field]]
id = "features"
label = "Features"
description = "Space or comma separated list of features to activate."
type = "string"
option = ["--features"]
sources = ["fig"]
[[commands.subcommand.field]]
id = "all_features"
label = "All features"
description = "Activate all available features."
type = "boolean"
option = ["--all-features"]
sources = ["fig"]
[[commands.subcommand.field]]
id = "no_default_features"
label = "No default features"
description = "Do not activate the default feature."
type = "boolean"
option = ["--no-default-features"]
sources = ["fig"]
[[commands.subcommand.field]]
id = "manifest_path"
label = "Manifest path"
description = "Path to Cargo.toml."
type = "path"
option = ["--manifest-path"]
path = { kind = "file", role = "input", must_exist = true }
sources = ["fig"]
[[commands.subcommand.field]]
id = "locked"
label = "Locked"
description = "Require Cargo.lock is up to date."
type = "boolean"
option = ["--locked"]
sources = ["fig"]
[[commands.subcommand.field]]
id = "offline"
label = "Offline"
description = "Run without accessing the network."
type = "boolean"
option = ["--offline"]
sources = ["fig"]
[[commands.subcommand.field]]
id = "verbose"
label = "Verbosity"
description = "Use verbose output (-vv very verbose)."
type = "count"
option = ["--verbose", "-v"]
sources = ["fig"]
[[commands.subcommand.field]]
id = "workspace"
label = "Whole workspace"
description = "Build all packages in the workspace."
type = "boolean"
option = ["--workspace"]
sources = ["fig"]
[[commands.subcommand.field]]
id = "lib"
label = "Library only"
description = "Build only this package's library."
type = "boolean"
option = ["--lib"]
sources = ["fig"]
[[commands.subcommand.field]]
id = "bin"
label = "Binary"
description = "Build only the specified binary."
type = "string"
option = ["--bin"]
sources = ["fig"]
[[commands.subcommand.field]]
id = "target"
label = "Target triple"
description = "Build for the target triple."
type = "string"
option = ["--target"]
sources = ["fig"]
[[commands.subcommand.task]]
id = "release"
label = "Release build"
set = { release = [true] }
fields = ["release", "package", "workspace"]
required = []
[[commands.subcommand.task]]
id = "workspace"
label = "Whole workspace"
set = { workspace = [true] }
fields = ["workspace", "release"]
required = []
[[commands.subcommand.group]]
id = "basic"
label = "Basic"
fields = ["release", "package", "workspace"]
[[commands.subcommand.group]]
id = "advanced"
label = "Advanced"
fields = ["features", "all_features", "no_default_features", "manifest_path", "locked", "offline", "verbose", "target", "lib", "bin"]
[[commands.subcommand]]
path = ["test"]
label = "Run tests"
description = "Execute unit and integration tests. Arguments after -- go to the test harness and are not covered."
[[commands.subcommand.source]]
id = "fig"
kind = "completion"
url = "https://github.com/withfig/autocomplete/blob/master/src/cargo.ts"
license = "MIT"
[[commands.subcommand.field]]
id = "testname"
label = "Test name filter"
description = "Only run tests whose name contains this string."
type = "string"
position = 0
sources = ["fig"]
[[commands.subcommand.field]]
id = "release"
label = "Release mode"
description = "Build artifacts in release mode, with optimizations."
type = "boolean"
option = ["--release", "-r"]
sources = ["fig"]
[[commands.subcommand.field]]
id = "package"
label = "Package"
description = "Package to test."
type = "string"
option = ["--package", "-p"]
sources = ["fig"]
[[commands.subcommand.field]]
id = "features"
label = "Features"
description = "Space or comma separated list of features to activate."
type = "string"
option = ["--features"]
sources = ["fig"]
[[commands.subcommand.field]]
id = "all_features"
label = "All features"
description = "Activate all available features."
type = "boolean"
option = ["--all-features"]
sources = ["fig"]
[[commands.subcommand.field]]
id = "no_default_features"
label = "No default features"
description = "Do not activate the default feature."
type = "boolean"
option = ["--no-default-features"]
sources = ["fig"]
[[commands.subcommand.field]]
id = "manifest_path"
label = "Manifest path"
description = "Path to Cargo.toml."
type = "path"
option = ["--manifest-path"]
path = { kind = "file", role = "input", must_exist = true }
sources = ["fig"]
[[commands.subcommand.field]]
id = "locked"
label = "Locked"
description = "Require Cargo.lock is up to date."
type = "boolean"
option = ["--locked"]
sources = ["fig"]
[[commands.subcommand.field]]
id = "offline"
label = "Offline"
description = "Run without accessing the network."
type = "boolean"
option = ["--offline"]
sources = ["fig"]
[[commands.subcommand.field]]
id = "verbose"
label = "Verbosity"
description = "Use verbose output (-vv very verbose)."
type = "count"
option = ["--verbose", "-v"]
sources = ["fig"]
[[commands.subcommand.field]]
id = "workspace"
label = "Whole workspace"
description = "Test all packages in the workspace."
type = "boolean"
option = ["--workspace"]
sources = ["fig"]
[[commands.subcommand.field]]
id = "lib"
label = "Library tests only"
description = "Test only this package's library unit tests."
type = "boolean"
option = ["--lib"]
sources = ["fig"]
[[commands.subcommand.field]]
id = "doc"
label = "Doc tests only"
description = "Test only this library's documentation."
type = "boolean"
option = ["--doc"]
sources = ["fig"]
[[commands.subcommand.field]]
id = "no_run"
label = "Compile only"
description = "Compile, but don't run tests."
type = "boolean"
option = ["--no-run"]
sources = ["fig"]
[[commands.subcommand.field]]
id = "no_fail_fast"
label = "Keep going on failure"
description = "Run all tests regardless of failure."
type = "boolean"
option = ["--no-fail-fast"]
sources = ["fig"]
[[commands.subcommand.task]]
id = "all"
label = "Test the workspace"
set = { workspace = [true] }
fields = ["workspace", "no_fail_fast"]
required = []
[[commands.subcommand.task]]
id = "one"
label = "Run matching tests"
fields = ["testname", "package"]
required = ["testname"]
[[commands.subcommand.group]]
id = "basic"
label = "Basic"
fields = ["testname", "release", "package", "workspace", "lib", "doc", "no_run", "no_fail_fast"]
[[commands.subcommand.group]]
id = "advanced"
label = "Advanced"
fields = ["features", "all_features", "no_default_features", "manifest_path", "locked", "offline", "verbose"]
[[commands.subcommand]]
path = ["run"]
label = "Run a binary"
description = "Build and run a binary or example. Program arguments after -- are not covered."
[[commands.subcommand.source]]
id = "fig"
kind = "completion"
url = "https://github.com/withfig/autocomplete/blob/master/src/cargo.ts"
license = "MIT"
[[commands.subcommand.field]]
id = "bin"
label = "Binary"
description = "Name of the bin target to run."
type = "string"
option = ["--bin"]
sources = ["fig"]
[[commands.subcommand.field]]
id = "example"
label = "Example"
description = "Name of the example target to run."
type = "string"
option = ["--example"]
sources = ["fig"]
[[commands.subcommand.field]]
id = "release"
label = "Release mode"
description = "Build artifacts in release mode, with optimizations."
type = "boolean"
option = ["--release", "-r"]
sources = ["fig"]
[[commands.subcommand.field]]
id = "package"
label = "Package"
description = "Package to run."
type = "string"
option = ["--package", "-p"]
sources = ["fig"]
[[commands.subcommand.field]]
id = "features"
label = "Features"
description = "Space or comma separated list of features to activate."
type = "string"
option = ["--features"]
sources = ["fig"]
[[commands.subcommand.field]]
id = "all_features"
label = "All features"
description = "Activate all available features."
type = "boolean"
option = ["--all-features"]
sources = ["fig"]
[[commands.subcommand.field]]
id = "no_default_features"
label = "No default features"
description = "Do not activate the default feature."
type = "boolean"
option = ["--no-default-features"]
sources = ["fig"]
[[commands.subcommand.field]]
id = "manifest_path"
label = "Manifest path"
description = "Path to Cargo.toml."
type = "path"
option = ["--manifest-path"]
path = { kind = "file", role = "input", must_exist = true }
sources = ["fig"]
[[commands.subcommand.field]]
id = "locked"
label = "Locked"
description = "Require Cargo.lock is up to date."
type = "boolean"
option = ["--locked"]
sources = ["fig"]
[[commands.subcommand.field]]
id = "offline"
label = "Offline"
description = "Run without accessing the network."
type = "boolean"
option = ["--offline"]
sources = ["fig"]
[[commands.subcommand.field]]
id = "verbose"
label = "Verbosity"
description = "Use verbose output (-vv very verbose)."
type = "count"
option = ["--verbose", "-v"]
sources = ["fig"]
[[commands.subcommand.task]]
id = "release"
label = "Run in release mode"
set = { release = [true] }
fields = ["bin", "release"]
required = []
[[commands.subcommand.group]]
id = "basic"
label = "Basic"
fields = ["bin", "example", "release", "package"]
[[commands.subcommand.group]]
id = "advanced"
label = "Advanced"
fields = ["features", "all_features", "no_default_features", "manifest_path", "locked", "offline", "verbose"]
[[commands.subcommand]]
path = ["new"]
label = "New package"
description = "Create a new cargo package in a new directory."
[[commands.subcommand.source]]
id = "fig"
kind = "completion"
url = "https://github.com/withfig/autocomplete/blob/master/src/cargo.ts"
license = "MIT"
[[commands.subcommand.field]]
id = "path"
label = "Directory"
description = "Directory to create."
type = "path"
position = 0
min = 1
path = { kind = "directory", role = "output" }
sources = ["fig"]
[[commands.subcommand.field]]
id = "lib"
label = "Library"
description = "Use a library template."
type = "boolean"
option = ["--lib"]
sources = ["fig"]
[[commands.subcommand.field]]
id = "bin"
label = "Binary"
description = "Use a binary (application) template (default)."
type = "boolean"
option = ["--bin"]
sources = ["fig"]
[[commands.subcommand.field]]
id = "name"
label = "Package name"
description = "Set the package name, defaults to the directory name."
type = "string"
option = ["--name"]
sources = ["fig"]
[[commands.subcommand.field]]
id = "edition"
label = "Edition"
description = "Edition to set for the crate generated."
type = "string"
option = ["--edition"]
suggestions = [{ value = "2015", label = "2015" }, { value = "2018", label = "2018" }, { value = "2021", label = "2021" }]
sources = ["fig"]
[[commands.subcommand.field]]
id = "vcs"
label = "Version control"
description = "Initialize a new repository for the given version control system."
type = "string"
option = ["--vcs"]
suggestions = [{ value = "git", label = "git" }, { value = "hg", label = "hg" }, { value = "pijul", label = "pijul" }, { value = "fossil", label = "fossil" }, { value = "none", label = "none" }]
sources = ["fig"]
[[commands.subcommand.task]]
id = "lib"
label = "New library"
set = { lib = [true] }
fields = ["path", "lib", "edition"]
required = ["path"]
[[commands.subcommand.task]]
id = "bin"
label = "New binary"
set = { bin = [true] }
fields = ["path", "bin", "edition"]
required = ["path"]
[[commands.subcommand.group]]
id = "basic"
label = "Basic"
fields = ["path", "lib", "bin"]
[[commands.subcommand.group]]
id = "advanced"
label = "Advanced"
fields = ["name", "edition", "vcs"]