1*Jump to [source](git.rs)* 2 3Git is an example of several common subcommand patterns. 4 5Help: 6```console 7$ git 8? failed 9git 10A fictional versioning CLI 11 12USAGE: 13 git[EXE] <SUBCOMMAND> 14 15OPTIONS: 16 -h, --help Print help information 17 18SUBCOMMANDS: 19 add adds things 20 clone Clones repos 21 help Print this message or the help of the given subcommand(s) 22 push pushes things 23 24$ git help 25git 26A fictional versioning CLI 27 28USAGE: 29 git[EXE] <SUBCOMMAND> 30 31OPTIONS: 32 -h, --help Print help information 33 34SUBCOMMANDS: 35 add adds things 36 clone Clones repos 37 help Print this message or the help of the given subcommand(s) 38 push pushes things 39 40$ git help add 41git[EXE]-add 42adds things 43 44USAGE: 45 git[EXE] add <PATH>... 46 47ARGS: 48 <PATH>... Stuff to add 49 50OPTIONS: 51 -h, --help Print help information 52 53``` 54 55A basic argument: 56```console 57$ git add 58? failed 59git[EXE]-add 60adds things 61 62USAGE: 63 git[EXE] add <PATH>... 64 65ARGS: 66 <PATH>... Stuff to add 67 68OPTIONS: 69 -h, --help Print help information 70 71$ git add Cargo.toml Cargo.lock 72Adding ["Cargo.toml", "Cargo.lock"] 73 74``` 75 76External subcommands: 77```console 78$ git custom-tool arg1 --foo bar 79Calling out to "custom-tool" with ["arg1", "--foo", "bar"] 80 81``` 82