#!/bin/sh
 
 # l_menu
 # ======
 
 # This file is part of Gerolf Markup Shredder,
 # written by G. D. Brettschneider (1999-2006).
 
 GMSdateL_MENU=20060927
 
 # Prologue: ==================================================================
  
 # Not running:
 
 if [ "$GMS_SHELL" = "" ]; then
   echo "This is Gerolf Markup Shredder (l_menu)."
   exit
 fi 
 
 # Debug: ---------------------------------------------------------------------
  
 if [ "$GMS_DEBUG" = "X" -o "$GMS_DEBUG" = "Y" ]; then
   source "$GMS_SHELL/l_banner" -debug l_menu $1 $2 $3 $4
 elif  [ "$GMS_DEBUG" = "Z" ]; then
   echo " l_menu ($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_menu
 
 # Update: --------------------------------------------------------------------
 
 elif [ $1 = -update ]; then
   # Cold:
   if [ "$3" = "" ]; then source "$GMS_SHELL/l_banner" -no_cold l_menu 
   elif [ $3 = Q ]; then "$GMS_REPLY" -item 5 "Quit    GMS program" Q 1
   elif [ $3 = C ]; then "$GMS_REPLY" -item 7 "Create  markup file" C 2
   elif [ $3 = O ]; then "$GMS_REPLY" -item 8 "Open    folder/file" O 3
   elif [ $3 = V ]; then "$GMS_REPLY" -item 9 "View    markup file" V 4
   elif [ $3 = E ]; then "$GMS_REPLY" -item 10 "Edit    markup file" E 5
   elif [ $3 = B ]; then "$GMS_REPLY" -item 11 "Browse  markup file" B 6
   elif [ $3 = A ]; then "$GMS_REPLY" -item 12 "Analyse folder/file" A 7
   elif [ $3 = T ]; then "$GMS_REPLY" -item 13 "Typeset markup file" T 8
   elif [ $3 = R ]; then "$GMS_REPLY" -item 14 "Read    output file" R 9
   elif [ $3 = L ]; then "$GMS_REPLY" -item 16 "Learn   GMS  tricks" L 10
   elif [ $3 = S ]; then "$GMS_REPLY" -item 17 "Select  GMS setting" S 11
   elif [ $3 = W ]; then "$GMS_REPLY" -item 18 "Write   GMS fontmap" W 12
   elif [ $3 = I ]; then "$GMS_REPLY" -item 19 "Init    GMS  format" I 13
   else source "$GMS_SHELL/l_banner" -no_cold l_menu $3; fi
   # Hot:
   if [ "$2" = "" ]; then source "$GMS_SHELL/l_banner" -no_hot l_menu
   elif [ $2 = Q ]; then "$GMS_REPLY" -item 5 "Quit    GMS program" QQ 1
   elif [ $2 = - ]; then "$GMS_REPLY" -item 6 " " " " 
   elif [ $2 = C ]; then "$GMS_REPLY" -item 7 "Create  markup file" CC 2
   elif [ $2 = O ]; then "$GMS_REPLY" -item 8 "Open    folder/file" OO 3
   elif [ $2 = V ]; then "$GMS_REPLY" -item 9 "View    markup file" VV 4
   elif [ $2 = E ]; then "$GMS_REPLY" -item 10 "Edit    markup file" EE 5
   elif [ $2 = B ]; then "$GMS_REPLY" -item 11 "Browse  markup file" BB 6
   elif [ $2 = A ]; then "$GMS_REPLY" -item 12 "Analyse folder/file" AA 7
   elif [ $2 = T ]; then "$GMS_REPLY" -item 13 "Typeset markup file" TT 8
   elif [ $2 = R ]; then "$GMS_REPLY" -item 14 "Read    output file" RR 9
   elif [ $2 = L ]; then "$GMS_REPLY" -item 16 "Learn G.M.S. tricks" LL 10
   elif [ $2 = S ]; then "$GMS_REPLY" -item 17 "Select  GMS setting" SS 11
   elif [ $2 = W ]; then "$GMS_REPLY" -item 18 "Write   GMS fontmap" WW 12
   elif [ $2 = I ]; then "$GMS_REPLY" -item 19 "Init    GMS  format" II 13
   else source "$GMS_SHELL/l_banner" -no_hot l_menu $2; fi
   
 # Build: ---------------------------------------------------------------------
 
 elif [ $1 = -build ]; then
   "$GMS_REPLY" -top 3 "-------- GMS --------" 
   "$GMS_REPLY" -item 4 " " " " 
   "$GMS_REPLY" -item 5 "Quit    GMS program" Q 1
   "$GMS_REPLY" -item 6 " " " "
   "$GMS_REPLY" -item 7 "Create  markup file" C 2
   "$GMS_REPLY" -item 8 "Open    folder/file" O 3
   "$GMS_REPLY" -item 9 "View    markup file" V 4
   "$GMS_REPLY" -item 10 "Edit    markup file" E 5
   "$GMS_REPLY" -item 11 "Browse  markup file" B 6
   "$GMS_REPLY" -item 12 "Analyse folder/file" A 7
   "$GMS_REPLY" -item 13 "Typeset markup file" T 8
   "$GMS_REPLY" -item 14 "Read    output file" R 9
   "$GMS_REPLY" -item 15 " " " "
   "$GMS_REPLY" -item 16 "Learn   GMS  tricks" L 10
   "$GMS_REPLY" -item 17 "Select  GMS setting" S 11
   "$GMS_REPLY" -item 18 "Write   GMS fontmap" W 12
   "$GMS_REPLY" -item 19 "Init    GMS  format" I 13
   "$GMS_REPLY" -item 20 " " " " 
   "$GMS_REPLY" -bottom 21
   "$GMS_REPLY" -shadow 22
   
 # Not found: -----------------------------------------------------------------
 
 else
   source "$GMS_SHELL/l_banner" -no_action l_menu $1   
 fi
