rename() fails on Windows if the destination exists.
[4msysgit-hv.git] / Documentation / cmd-list.perl
blob5680dcbf9ab7a9f05a2cf9725942b266fa7586d5
3 sub format_one {
4 my ($out, $name) = @_;
5 my ($state, $description);
6 open I, '<', "$name.txt" or die "No such file $name.txt";
7 while (<I>) {
8 if (/^NAME$/) {
9 $state = 1;
10 next;
12 if ($state == 1 && /^----$/) {
13 $state = 2;
14 next;
16 next if ($state != 2);
17 chomp;
18 $description = $_;
19 last;
21 close I;
22 if (!defined $description) {
23 die "No description found in $name.txt";
25 if (my ($verify_name, $text) = ($description =~ /^($name) - (.*)/)) {
26 print $out "gitlink:$name\[1\]::\n";
27 print $out "\t$text.\n\n";
29 else {
30 die "Description does not match $name: $description";
34 my %cmds = ();
35 while (<DATA>) {
36 next if /^#/;
38 chomp;
39 my ($name, $cat) = /^(\S+)\s+(.*)$/;
40 push @{$cmds{$cat}}, $name;
43 for my $cat (qw(ancillaryinterrogators
44 ancillarymanipulators
45 mainporcelain
46 plumbinginterrogators
47 plumbingmanipulators
48 synchingrepositories)) {
49 my $out = "cmds-$cat.txt";
50 open O, '>', "$out+" or die "Cannot open output file $out+";
51 for (@{$cmds{$cat}}) {
52 format_one(\*O, $_);
54 close O;
55 rename "$out+", "$out";
58 __DATA__
59 git-add mainporcelain
60 git-am mainporcelain
61 git-annotate ancillaryinterrogators
62 git-applymbox mainporcelain
63 git-applypatch ancillarymanipulators
64 git-apply plumbingmanipulators
65 git-archimport ancillarymanipulators
66 git-archive mainporcelain
67 git-bisect mainporcelain
68 git-blame ancillaryinterrogators
69 git-branch mainporcelain
70 git-cat-file plumbinginterrogators
71 git-checkout-index plumbingmanipulators
72 git-checkout mainporcelain
73 git-check-ref-format ancillaryinterrogators
74 git-cherry ancillaryinterrogators
75 git-cherry-pick mainporcelain
76 git-clean mainporcelain
77 git-clone mainporcelain
78 git-commit mainporcelain
79 git-commit-tree plumbingmanipulators
80 git-convert-objects ancillarymanipulators
81 git-count-objects ancillaryinterrogators
82 git-cvsexportcommit ancillarymanipulators
83 git-cvsimport ancillarymanipulators
84 git-cvsserver ancillarymanipulators
85 git-daemon ancillaryinterrogators
86 git-describe plumbinginterrogators
87 git-diff-files plumbinginterrogators
88 git-diff-index plumbinginterrogators
89 git-diff mainporcelain
90 git-diff-stages plumbinginterrogators
91 git-diff-tree plumbinginterrogators
92 git-fetch mainporcelain
93 git-fetch-pack synchingrepositories
94 git-fmt-merge-msg ancillaryinterrogators
95 git-for-each-ref plumbinginterrogators
96 git-format-patch mainporcelain
97 git-fsck-objects plumbinginterrogators
98 git-gc ancillarymanipulators
99 git-get-tar-commit-id ancillaryinterrogators
100 git-grep mainporcelain
101 git-hash-object plumbingmanipulators
102 git-http-fetch synchingrepositories
103 git-http-push synchingrepositories
104 git-imap-send ancillaryinterrogators
105 git-index-pack plumbingmanipulators
106 git-init plumbingmanipulators
107 git-instaweb ancillaryinterrogators
108 gitk mainporcelain
109 git-local-fetch synchingrepositories
110 git-log mainporcelain
111 git-lost-found ancillarymanipulators
112 git-ls-files plumbinginterrogators
113 git-ls-remote mainporcelain
114 git-ls-tree plumbinginterrogators
115 git-mailinfo ancillaryinterrogators
116 git-mailsplit ancillaryinterrogators
117 git-merge-base plumbinginterrogators
118 git-merge-file plumbingmanipulators
119 git-merge-index plumbingmanipulators
120 git-merge mainporcelain
121 git-merge-one-file ancillarymanipulators
122 git-merge-tree ancillaryinterrogators
123 git-mktag plumbingmanipulators
124 git-mktree plumbingmanipulators
125 git-mv mainporcelain
126 git-name-rev plumbinginterrogators
127 git-pack-objects plumbingmanipulators
128 git-pack-redundant plumbinginterrogators
129 git-pack-refs mainporcelain
130 git-parse-remote ancillaryinterrogators
131 git-patch-id ancillaryinterrogators
132 git-peek-remote synchingrepositories
133 git-prune ancillarymanipulators
134 git-prune-packed plumbingmanipulators
135 git-pull mainporcelain
136 git-push mainporcelain
137 git-quiltimport ancillarymanipulators
138 git-read-tree plumbingmanipulators
139 git-rebase mainporcelain
140 git-receive-pack synchingrepositories
141 git-reflog ancillarymanipulators
142 git-relink ancillarymanipulators
143 git-repack mainporcelain
144 git-repo-config plumbingmanipulators
145 git-request-pull ancillaryinterrogators
146 git-rerere mainporcelain
147 git-reset mainporcelain
148 git-resolve mainporcelain
149 git-revert mainporcelain
150 git-rev-list plumbinginterrogators
151 git-rev-parse ancillaryinterrogators
152 git-rm mainporcelain
153 git-runstatus ancillaryinterrogators
154 git-send-email ancillaryinterrogators
155 git-send-pack synchingrepositories
156 git-shell synchingrepositories
157 git-shortlog mainporcelain
158 git-show mainporcelain
159 git-show-branch mainporcelain
160 git-show-index plumbinginterrogators
161 git-show-ref plumbinginterrogators
162 git-sh-setup ancillarymanipulators
163 git-ssh-fetch synchingrepositories
164 git-ssh-upload synchingrepositories
165 git-status mainporcelain
166 git-stripspace ancillaryinterrogators
167 git-svn ancillarymanipulators
168 git-svnimport ancillarymanipulators
169 git-symbolic-ref ancillaryinterrogators
170 git-symbolic-ref ancillarymanipulators
171 git-tag ancillarymanipulators
172 git-tar-tree plumbinginterrogators
173 git-unpack-file plumbinginterrogators
174 git-unpack-objects plumbingmanipulators
175 git-update-index plumbingmanipulators
176 git-update-ref ancillarymanipulators
177 git-update-server-info synchingrepositories
178 git-upload-archive synchingrepositories
179 git-upload-pack synchingrepositories
180 git-var plumbinginterrogators
181 git-verify-pack plumbinginterrogators
182 git-verify-tag mainporcelain
183 git-whatchanged mainporcelain
184 git-write-tree plumbingmanipulators