generate_manpages.sh 2.16 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/usr/bin/env bash
if ! which help2man &> /dev/null; then
	echo "Please install help2man"
	exit 1
fi

if ! which gzip &> /dev/null; then
	echo "Please install gzip"
	exit 1
fi

API=$(cd $(dirname $0); pwd)
FILES="\
14
15
16
17
18
19
20
21
create_all_collections \
create_all_roles \
create_collection \
create_db \
create_project \
create_role \
create_user \
delete_compile_commands \
22
delete_doc_files \
23
24
25
26
27
28
29
30
delete_docs \
delete_executable_binary_files \
delete_project \
delete_source_files \
delete_uml_class_diagrams \
delete_uml_files \
delete_uml_state_machines \
drop_all_collections \
31
drop_all_roles \
32
drop_all_users \
33
34
drop_collection \
drop_db \
35
drop_role \
36
drop_user \
37
38
39
40
41
42
43
finalize_PKM \
find_in_cpp_class \
find_in_cpp_source \
find_in_c_source \
find_in_doc \
find_in_java_class \
find_in_java_source \
44
find_in_uml_class_diagrams \
45
46
get_c_annotations \
get_c_comments \
47
get_compile_commands \
48
49
get_cpp_annotations \
get_cpp_comments \
50
51
52
get_cpp_source_codes \
get_c_source_codes \
get_doc_files \
Gilles Mouchard's avatar
Gilles Mouchard committed
53
get_docs \
Gilles Mouchard's avatar
Gilles Mouchard committed
54
get_executable_binary_files \
55
56
57
58
59
60
61
62
63
get_files \
get_invocations \
get_project \
get_projects \
get_source_files \
get_tools \
get_uml_class_diagrams \
get_uml_files \
get_uml_state_machines \
64
get_users \
65
66
67
68
get_user_projects \
initialize_PKM \
insert_compile_commands \
insert_doc_files \
Gilles Mouchard's avatar
Gilles Mouchard committed
69
insert_executable_binary_files \
70
71
72
73
74
75
76
77
78
79
80
81
82
insert_files \
insert_source_files \
insert_testar_state_model_files \
insert_testar_test_results_files \
insert_uml_class_diagram_files \
insert_uml_files \
insert_uml_state_machine_files \
run_asfm_to_doc \
run_doc_to_asfm \
run_frama_c \
run_frama_clang \
update_compile_commands \
update_doc_files \
Gilles Mouchard's avatar
Gilles Mouchard committed
83
update_executable_binary_files \
84
85
86
87
88
89
90
update_files \
update_source_files \
update_uml_class_diagram_files \
update_uml_files \
update_uml_state_machine_files \
update_user_password \
update_user_role \
91
92
93
"

mkdir -p "${API}/documentation/man/man1"
94
rm -f "${API}/documentation/man/man1"/*.1
95
96
for FILE in ${FILES}; do
	echo -n "Generating manpage for '${FILE}': "
97
	if [ -x "${API}/bin/${FILE}" ] && help2man "${API}/bin/${FILE}" | gzip > "${API}/documentation/man/man1/${FILE}.1"; then
98
99
100
101
102
103
104
		echo "success"
	else
		echo "failure"
		exit 1
	fi
done

105
106
echo "Success"
echo "The manpages are in '${API}/documentation/man'"
107
exit 0