#!/bin/sh
 
 # l_select
 # ========
 
 # This file is part of Gerolf Markup Shredder,
 # written by G. D. Brettschneider (1999-2006).
 
 GMSdateL_SELECT=20060927
 
 # Prologue: ==================================================================
 
 # Not running:
 
 if [ "$GMS_SHELL" = "" ]; then
   echo "This is Gerolf Markup Shredder (l_select)."
   exit
 fi 
 
 # Debug: ---------------------------------------------------------------------
   
 if [ "$GMS_DEBUG" = "X" -o "$GMS_DEBUG" = "Y" ]; then
   source "$GMS_SHELL/l_banner" -debug l_select $1 $2 $3 $4
 elif  [ "$GMS_DEBUG" = "Z" ]; then
   echo " l_select ($1) ($2) ($3) ($4) ($5) ($6) ($7) ($8) ($9)" >> "$Z"
 fi 
 
 # Chapters: ==================================================================
 
 # Not defined:
 
 if [ "$1" = "" ]; then
   source "$GMS_SHELL/l_banner" -no_action l_select
 
 # Update: --------------------------------------------------------------------
 
 elif [ $1 = -update ]; then
 # Cold:
   if [ "$3" = "" ]; then source "$GMS_SHELL/l_banner" -no_cold l_select
   elif [ $3 = Q ]; then "$GMS_REPLY" -item 5 "Quit dialog >" Q 1
   elif [ $3 = A ]; then "$GMS_REPLY" -item 7 "Animation $4" A 2
   elif [ $3 = C ]; then "$GMS_REPLY" -item 8 "Colors      >" C 3
   elif [ $3 = P ]; then "$GMS_REPLY" -item 9 "Programs    >" P 4
   elif [ $3 = D ]; then "$GMS_REPLY" -item 10 "Debugging:" D 5
     if [ "$GMS_DEBUG" = "X" ]; then "$GMS_REPLY" -item 11 "$GMS_DEBUG" X
     elif [ "$GMS_DEBUG" = "Y" ]; then "$GMS_REPLY" -item 11 "$GMS_DEBUG" Y
     else "$GMS_REPLY" -item 11 "$GMS_DEBUG" 0; fi
   elif [ $3 = E ]; then "$GMS_REPLY" -item 12 "Encoding:" E 6
     "$GMS_REPLY" -item 13 "$GMS_CODEPAGE" I
   elif [ $3 = I ]; then "$GMS_REPLY" -item 13 "$GMS_CODEPAGE" I 
   elif [ $3 = U ]; then "$GMS_REPLY" -item 14 "Upper half  >" U 7
   elif [ $3 = L ]; then "$GMS_REPLY" -item 15 "Lower half  >" L 8
   else source "$GMS_SHELL/l_banner" -no_cold l_select $3; fi
 # Hot:
   if [ "$2" = "" ]; then source "$GMS_SHELL/l_banner" -no_hot l_select $2
   elif [ $2 = - ]; then "$GMS_REPLY" -item 4 " " " "
   elif [ $2 = Q ]; then "$GMS_REPLY" -item 5 "Quit dialog >" QQ 1
   elif [ $2 = A ]; then "$GMS_REPLY" -item 7 "Animation $4" AA 2
   elif [ $2 = C ]; then "$GMS_REPLY" -item 8 "Colors      >" CC 3
   elif [ $2 = P ]; then "$GMS_REPLY" -item 9 "Programs    >" PP 4
   elif [ $2 = D ]; then "$GMS_REPLY" -item 10 "Debugging:" DD 5
   elif [ $2 = E ]; then "$GMS_REPLY" -item 12 "Encoding:" EE 6
   elif [ $2 = U ]; then "$GMS_REPLY" -item 14 "Upper half  >" UU 7
   elif [ $2 = L ]; then "$GMS_REPLY" -item 15 "Lower half  >" LL 8
   else source "$GMS_SHELL/l_banner" -no_hot l_select $2; fi 
   
 # Build: ---------------------------------------------------------------------
 
 elif [ $1 = -build ]; then
   "$GMS_REPLY" -top 3 "Select / Show"
   "$GMS_REPLY" -item 4 " " " "
   "$GMS_REPLY" -item 5 "Quit dialog >" Q 1
   "$GMS_REPLY" -item 6 " " " " 
   "$GMS_REPLY" -item 7 "Animation $2" A 2
   "$GMS_REPLY" -item 8 "Colors      >" C 3
   "$GMS_REPLY" -item 9 "Programs    >" P 4
   "$GMS_REPLY" -item 10 "Debugging:" D 5
   if [ $GMS_DEBUG = X ]; then "$GMS_REPLY" -item 11 "$GMS_DEBUG" X
   elif [ $GMS_DEBUG = Y ]; then "$GMS_REPLY" -item 11 "$GMS_DEBUG" Y
   elif [ $GMS_DEBUG = Z ]; then "$GMS_REPLY" -item 11 "$GMS_DEBUG" Z
   else "$GMS_REPLY" -item 11 "$GMS_DEBUG" 0; fi
   "$GMS_REPLY" -item 12 "Encoding:" E 6
   "$GMS_REPLY" -item 13 "$GMS_CODEPAGE" I
   "$GMS_REPLY" -item 14 "Upper half  >" U 7
   "$GMS_REPLY" -item 15 "Lower half  >" L 8
   "$GMS_REPLY" -item 16 " " " " 
   "$GMS_REPLY" -bottom 17
   "$GMS_REPLY" -shadow 18
   
 # Not found: -----------------------------------------------------------------
 
 else
   source "$GMS_SHELL/l_banner" -no_action l_select $1   
 fi
