You've already forked training_material
mirror of
https://github.com/AdaCore/training_material.git
synced 2026-02-12 13:08:57 -08:00
30 lines
634 B
Bash
Executable File
30 lines
634 B
Bash
Executable File
#! /usr/bin/bash
|
|
|
|
DEFAULT_COURSE="courses/ada_essentials"
|
|
|
|
usage() {
|
|
echo "$0 [course_path]"
|
|
echo "$0 -h"
|
|
echo
|
|
echo "List all the definitions in the course_path (default $DEFAULT_COURSE)"
|
|
echo "in the CSV format and ordered."
|
|
echo
|
|
echo "The following format is used"
|
|
echo
|
|
echo " definition,file_name,line_number"
|
|
echo
|
|
echo "OPTIONS"
|
|
echo
|
|
echo "-h Displays this help"
|
|
}
|
|
|
|
if [ "$1" == "-h" ]; then
|
|
usage
|
|
exit 0
|
|
fi
|
|
|
|
course=${1:-$DEFAULT_COURSE}
|
|
|
|
# shellcheck disable=SC2016
|
|
grep -rn :dfn: "$course" | sed -n 's/\(.*\):\([0-9][0-9]*\).*:dfn:`\(.*\)`.*/\l\3,\1,\2/p' | sort
|