]> git.proxmox.com Git - cargo.git/blob - vendor/clap/examples/git.md
Merge branch 'debian/sid' into proxmox/bullseye
[cargo.git] / vendor / clap / examples / git.md
1 Git is an example of several common subcommand patterns.
2
3 Help:
4 ```console
5 $ git
6 ? failed
7 git
8 A fictional versioning CLI
9
10 USAGE:
11 git[EXE] <SUBCOMMAND>
12
13 OPTIONS:
14 -h, --help Print help information
15
16 SUBCOMMANDS:
17 add adds things
18 clone Clones repos
19 help Print this message or the help of the given subcommand(s)
20 push pushes things
21 stash
22
23 $ git help
24 git
25 A fictional versioning CLI
26
27 USAGE:
28 git[EXE] <SUBCOMMAND>
29
30 OPTIONS:
31 -h, --help Print help information
32
33 SUBCOMMANDS:
34 add adds things
35 clone Clones repos
36 help Print this message or the help of the given subcommand(s)
37 push pushes things
38 stash
39
40 $ git help add
41 git[EXE]-add
42 adds things
43
44 USAGE:
45 git[EXE] add <PATH>...
46
47 ARGS:
48 <PATH>... Stuff to add
49
50 OPTIONS:
51 -h, --help Print help information
52
53 ```
54
55 A basic argument:
56 ```console
57 $ git add
58 ? failed
59 git[EXE]-add
60 adds things
61
62 USAGE:
63 git[EXE] add <PATH>...
64
65 ARGS:
66 <PATH>... Stuff to add
67
68 OPTIONS:
69 -h, --help Print help information
70
71 $ git add Cargo.toml Cargo.lock
72 Adding ["Cargo.toml", "Cargo.lock"]
73
74 ```
75
76 Default subcommand:
77 ```console
78 $ git stash -h
79 git[EXE]-stash
80
81 USAGE:
82 git[EXE] stash [OPTIONS]
83 git[EXE] stash <SUBCOMMAND>
84
85 OPTIONS:
86 -h, --help Print help information
87 -m, --message <MESSAGE>
88
89 SUBCOMMANDS:
90 apply
91 help Print this message or the help of the given subcommand(s)
92 pop
93 push
94
95 $ git stash push -h
96 git[EXE]-stash-push
97
98 USAGE:
99 git[EXE] stash push [OPTIONS]
100
101 OPTIONS:
102 -h, --help Print help information
103 -m, --message <MESSAGE>
104
105 $ git stash pop -h
106 git[EXE]-stash-pop
107
108 USAGE:
109 git[EXE] stash pop [STASH]
110
111 ARGS:
112 <STASH>
113
114 OPTIONS:
115 -h, --help Print help information
116
117 $ git stash -m "Prototype"
118 Pushing Some("Prototype")
119
120 $ git stash pop
121 Popping None
122
123 $ git stash push -m "Prototype"
124 Pushing Some("Prototype")
125
126 $ git stash pop
127 Popping None
128
129 ```
130
131 External subcommands:
132 ```console
133 $ git custom-tool arg1 --foo bar
134 Calling out to "custom-tool" with ["arg1", "--foo", "bar"]
135
136 ```