1
1
#! /bin/sh
2
2
3
+ # Usage info
4
+ usage ()
5
+ {
6
+ echo " Usage:\n\nlist_unsupported.sh path_to_ada_source_folder\n"
7
+ echo " Run GNAT2Goto on an Ada repository.\n"
8
+ echo " The output is an ordered list of currently unsupported features"
9
+ echo " with the number of times they occur in the input repository.\n"
10
+ echo " The script builds a parsing program using collect_unsupported.cpp and expects"
11
+ echo " this file to be in the same folder.\n"
12
+ }
13
+
3
14
# First check some environment prerequisites
4
15
echo >&2 " Checking environment..."
5
16
@@ -12,21 +23,6 @@ if ! command -v gnat2goto > /dev/null; then
12
23
exit 1
13
24
fi
14
25
15
- if [ " $# " -ne 1 ]; then
16
- echo >&2 " Provide folder name to start"
17
- exit 2
18
- fi
19
-
20
- if [ " $1 " = ' --help' ]; then
21
- echo " Run GNAT2Goto on an Ada repository.\n"
22
- echo " The output is an ordered list of currently unsupported features"
23
- echo " with the number of times they occur in the input repository.\n"
24
- echo " The script builds a parsing program using collect_unsupported.cpp and expects"
25
- echo " this file to be in the same folder.\n"
26
- echo " Usage:\n\nlist_unsupported.sh path_to_ada_source_folder"
27
- exit 3
28
- fi
29
-
30
26
# gnat on the path?
31
27
if ! command -v gnat > /dev/null; then
32
28
echo >&2 " Gnat not on PATH!"
@@ -94,6 +90,20 @@ export PATH="${saved_path}"
94
90
95
91
echo >&2 " ...environment is OK."
96
92
93
+
94
+ # Command line processing....
95
+
96
+ if [ " $1 " = ' --help' ]; then
97
+ usage
98
+ exit
99
+ fi
100
+
101
+ if [ " $# " -ne 1 ]; then
102
+ usage >&2
103
+ echo >&2 " Only a single folder name may be specified"
104
+ exit 2
105
+ fi
106
+
97
107
# Finally start work
98
108
99
109
echo >&2 " Project to build: $1 "
0 commit comments