Skip to content

Commit e7f00b3

Browse files
committed
Auto merge of #5971 - dwijnand:one-architecture, r=alexcrichton
Migrate some architecture notes from the wiki Merge https://github.com/rust-lang/cargo/wiki/Cargo's-architecture into the ARCHITECTURE.md in the repo. Fixes #5528
2 parents 86c9c51 + 37a64d4 commit e7f00b3

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

ARCHITECTURE.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,27 @@ This document gives a high level overview of Cargo internals. You may
44
find it useful if you want to contribute to Cargo or if you are
55
interested in the inner workings of Cargo.
66

7+
The purpose of Cargo is to formalize a canonical Rust workflow, by automating
8+
the standard tasks associated with distributing software. Cargo simplifies
9+
structuring a new project, adding dependencies, writing and running unit tests,
10+
and more.
11+
712

813
## Subcommands
914

10-
Cargo is organized as a set of `clap` subcommands. All subcommands live in
15+
Cargo is a single binary composed of a set of [`clap`][] subcommands. All subcommands live in
1116
`src/bin/cargo/commands` directory. `src/bin/cargo/main.rs` is the entry point.
1217

13-
A typical subcommand, such as `src/bin/cargo/commands/build.rs`, parses command line
14-
options, reads the configuration files, discovers the Cargo project in
15-
the current directory and delegates the actual implementation to one
18+
Each subcommand, such as `src/bin/cargo/commands/build.rs`, has its own API
19+
interface, similarly to Git's, parsing command line options, reading the
20+
configuration files, discovering the Cargo project in the current directory and
21+
delegating the actual implementation to one
1622
of the functions in `src/cargo/ops/mod.rs`. This short file is a good
1723
place to find out about most of the things that Cargo can do.
24+
Subcommands are designed to pipe to one another, and custom subcommands make
25+
Cargo easy to extend and attach tools to.
26+
27+
[`clap`]: https://clap.rs/
1828

1929

2030
## Important Data Structures

0 commit comments

Comments
 (0)