1 **This requires enabling the [`derive` feature flag][crate::_features].**
3 Git is an example of several common subcommand patterns.
9 A fictional versioning CLI
11 Usage: git-derive[EXE] <COMMAND>
15 diff Compare two commits
19 help Print this message or the help of the given subcommand(s)
25 A fictional versioning CLI
27 Usage: git-derive[EXE] <COMMAND>
31 diff Compare two commits
35 help Print this message or the help of the given subcommand(s)
43 Usage: git-derive[EXE] add <PATH>...
46 <PATH>... Stuff to add
59 Usage: git-derive[EXE] add <PATH>...
62 <PATH>... Stuff to add
67 $ git-derive add Cargo.toml Cargo.lock
68 Adding ["Cargo.toml", "Cargo.lock"]
75 Usage: git-derive[EXE] stash [OPTIONS]
76 git-derive[EXE] stash <COMMAND>
82 help Print this message or the help of the given subcommand(s)
85 -m, --message <MESSAGE>
88 $ git-derive stash push -h
89 Usage: git-derive[EXE] stash push [OPTIONS]
92 -m, --message <MESSAGE>
95 $ git-derive stash pop -h
96 Usage: git-derive[EXE] stash pop [STASH]
102 -h, --help Print help
104 $ git-derive stash -m "Prototype"
105 Pushing StashPush { message: Some("Prototype") }
107 $ git-derive stash pop
110 $ git-derive stash push -m "Prototype"
111 Pushing StashPush { message: Some("Prototype") }
113 $ git-derive stash pop
118 External subcommands:
120 $ git-derive custom-tool arg1 --foo bar
121 Calling out to "custom-tool" with ["arg1", "--foo", "bar"]
127 $ git-derive diff --help
130 Usage: git-derive[EXE] diff [OPTIONS] [COMMIT] [COMMIT] [-- <PATH>]
138 --color[=<WHEN>] [default: auto] [possible values: always, auto, never]
139 -h, --help Print help
142 Diffing stage..worktree (color=auto)
144 $ git-derive diff ./src
145 Diffing stage..worktree ./src (color=auto)
147 $ git-derive diff HEAD ./src
148 Diffing HEAD..worktree ./src (color=auto)
150 $ git-derive diff HEAD~~ -- HEAD
151 Diffing HEAD~~..worktree HEAD (color=auto)
153 $ git-derive diff --color
154 Diffing stage..worktree (color=always)
156 $ git-derive diff --color=never
157 Diffing stage..worktree (color=never)