1 /* Copyright (c) 2006-2014 Jonas Fonseca <jonas.fonseca@gmail.com>
3 * This program is free software; you can redistribute it and/or
4 * modify it under the terms of the GNU General Public License as
5 * published by the Free Software Foundation; either version 2 of
6 * the License, or (at your option) any later version.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
15 #include "tig/request.h"
18 struct doc_action_iterator
{
24 doc_action_group_name_print(const char *group
)
26 printf("%s\n", group
);
33 doc_action_table_print(bool start
)
36 printf("[frame=\"none\",grid=\"none\",cols=\"25<m,75<\"]\n");
37 printf("|=============================================================================\n");
41 doc_action_print(void *data
, const struct request_info
*req_info
, const char *group
)
43 struct doc_action_iterator
*iterator
= data
;
45 if (iterator
->group
!= group
) {
46 if (iterator
->end_group
) {
47 doc_action_table_print(FALSE
);
51 doc_action_group_name_print(group
);
52 doc_action_table_print(TRUE
);
54 iterator
->group
= group
;
55 iterator
->end_group
= TRUE
;
58 printf("|%-24s|%s\n", enum_name(req_info
->name
), req_info
->help
);
63 doc_actions_print(void)
65 struct doc_action_iterator iterator
= { FALSE
};
67 foreach_request(doc_action_print
, &iterator
);
68 doc_action_table_print(FALSE
);
72 main(int argc
, const char *argv
[])
76 for (i
= 1; i
< argc
; i
++) {
77 if (!strcmp(argv
[i
], "actions"))
84 /* vim: set ts=8 sw=8 noexpandtab: */