Skip to content

Commit

Permalink
both rnc -> odd scripts take options to debug specific modules
Browse files Browse the repository at this point in the history
  • Loading branch information
EsGeh authored and EsGeh committed Aug 5, 2019
1 parent f52591e commit 68631de
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion scripts/rnc_analysis_to_odd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ input_dir="$BASE_DIR/schema/legacy/generated/analysis"
output_dir="$BASE_DIR/schema/legacy/generated"
verbosity="2"
modules=
debug_modules=()

#######################################
# functions
Expand All @@ -31,6 +32,7 @@ function print_help {
echo " -o|--output-dir OUTPUT_DIR. default: '$output_dir'"
echo " -m|--modules 'MODULE1 MODULE2'. Overwrite which TEI modules to include"
echo " -v|--verbosity (0: only errors, 1: warnings, 2: info, 3: debug). default: $verbosity"
echo " -d|--debug-module VAL (multiple options accumulate): send debug messages for the specific module"
}

#######################################
Expand Down Expand Up @@ -64,6 +66,11 @@ while [[ $# > 0 ]]; do
modules="$1"
shift
;;
-d | --debug-module)
shift
debug_modules+=("$1")
shift
;;
-* )
echo "wrong syntax!"
print_help
Expand Down Expand Up @@ -93,13 +100,14 @@ input_filename=$(cat $input_dir/info.cfg | grep 'SOURCE' | cut -d' ' -f2)

input_dir_absolute=$(readlink -f "$input_dir")

debug_modules_options="debug_modules=${debug_modules[@]}"

echo "analysis -> tei: '$input_dir -> $output_dir/*.tei'"
$SCRIPT_DIR/local_stylesheet.sh \
--input-dir "$input_dir" \
--output-dir "$output_dir" \
--suffix ".odd" \
--options "analysis_dir=$input_dir_absolute input_filename=$input_filename verbosity=$verbosity $module_param" \
--options "analysis_dir=$input_dir_absolute input_filename=$input_filename verbosity=$verbosity $module_param $debug_modules_options" \
rng_to_odd/analysis_to_odd.xsl \
1_simple.xml
# filename is just given to avoid the script
Expand Down

0 comments on commit 68631de

Please sign in to comment.