subcommand
The word after a program's name that picks which of its operations to run, such as status in git status.
In more detail
Large tools group their operations as subcommands, each with its own options and help page. Options before the subcommand usually apply to the tool as a whole, and options after it to that operation.
Examples
git statusgit help loggo mod tidy # mod is the subcommand, tidy its actionRelated terms
- command-line interface — A program you control by typing commands as text in a terminal instead of clicking in a window.
- command-line option — An argument starting with a dash, such as -r or --help, that changes how a command behaves rather than naming what it works on.
- Cobra — A widely used third-party Go library for building command-line tools with subcommands, nested help and shell completion.
- go command — The single command-line program that ships with Go and builds, runs, tests, formats and documents your code through subcommands.
Taught in
- Conventional Commits — Advanced Git Internals & Distributed Workflows
- What A Remote Actually Is — Advanced Git Internals & Distributed Workflows
- What Go Is and Why It Matters — Concurrent Systems Programming with Go
- Installing the Go Toolchain — Concurrent Systems Programming with Go
- Variables, Typing, and Zero Values — Concurrent Systems Programming with Go
- Parsing Arguments with flag — Concurrent Systems Programming with Go