# -*- shell-script -*- # "set showcommand" debugger command # # Copyright (C) 2010, 2011 Rocky Bernstein # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; see the file COPYING. If not, write to # the Free Software Foundation, 59 Temple Place, Suite 330, Boston, # MA 02111 USA. _Dbg_help_add_sub set showcommand \ 'Set showcommand [on|off] Set showing the command to execute.' 1 # Sets whether or not to display command to be executed in debugger prompt. # If yes, always show. If auto, show only if the same line is to be run # but the command is different. typeset _Dbg_set_show_command="auto" _Dbg_next_complete[set showcommand]='_Dbg_complete_onoff' proc _Dbg_do_set_showcommand { matchstr $1 { 1 { _Dbg_write_journal_eval "_Dbg_set_show_command=on" } 0 { _Dbg_write_journal_eval "_Dbg_set_show_command=off" } on | off | auto { _Dbg_write_journal_eval "_Dbg_set_show_command=$1" } * { _Dbg_errmsg "\"on\", \"off\" or \"auto\" expected." } } return 0 } (CommandList children: [ (C {(_Dbg_help_add_sub)} {(set)} {(showcommand)} {(SQ <"Set showcommand [on|off]\n"> <"\n"> <"Set showing the command to execute.">)} {(1)} ) (C {(typeset)} {(Lit_VarLike "_Dbg_set_show_command=") (DQ (auto))}) (C {(_Dbg_next_complete) (Lit_Other "[") (set)} {(showcommand) (Lit_Other "]") (Lit_Other "=") (SQ <_Dbg_complete_onoff>)} ) (FuncDef name: _Dbg_do_set_showcommand body: (BraceGroup children: [ (Case to_match: {($ VSub_Number "$1")} arms: [ (case_arm pat_list: [{(1)}] action: [(C {(_Dbg_write_journal_eval)} {(DQ ("_Dbg_set_show_command=on"))})] spids: [118 120 130 -1] ) (case_arm pat_list: [{(0)}] action: [(C {(_Dbg_write_journal_eval)} {(DQ ("_Dbg_set_show_command=off"))})] spids: [133 135 145 -1] ) (case_arm pat_list: [{(on)} {(off)} {(auto)}] action: [ (C {(_Dbg_write_journal_eval)} {(DQ ("_Dbg_set_show_command=") ($ VSub_Number "$1"))} ) ] spids: [148 158 169 -1] ) (case_arm pat_list: [{(Lit_Other "*")}] action: [ (C {(_Dbg_errmsg)} { (DQ (EscapedLiteralPart token:) (on) (EscapedLiteralPart token: ) (", ") (EscapedLiteralPart token:) (off) (EscapedLiteralPart token: ) (" or ") (EscapedLiteralPart token:) (auto) (EscapedLiteralPart token: ) (" expected.") ) } ) ] spids: [172 174 -1 195] ) ] spids: [110 114 195] ) (ControlFlow token: arg_word:{(0)}) ] spids: [107] ) spids: [103 106] ) ] )