(command.CommandList children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:USAGE) op: assign_op.Equal rhs: {(SQ <'[--browser=browser|--tool=browser] [--config=conf.var] url/file ...'>)} spids: [52] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:NONGIT_OK) op: assign_op.Equal rhs: {<Yes>} spids: [64] ) ] ) (C {<.>} {<git-sh-setup>}) (command.ShFunction name: valid_custom_tool body: (command.BraceGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:browser_cmd) op: assign_op.Equal rhs: { (DQ (command_sub left_token: <Id.Left_DollarParen '$('> command_list: (command.CommandList children: [ (C {<git>} {<config>} {(DQ <browser.> ($ Id.VSub_Number '$1') <.cmd>)}) ] ) ) ) } spids: [79] ) ] ) (C {<test>} {<-n>} {(DQ ($ Id.VSub_DollarName '$browser_cmd'))}) ] ) ) (command.ShFunction name: valid_tool body: (command.BraceGroup children: [ (command.Case to_match: {(DQ ($ Id.VSub_Number '$1'))} arms: [ (case_arm pat_list: [ {<firefox>} {<iceweasel>} {<seamonkey>} {<iceape>} {<chrome>} {<google-chrome>} {<chromium>} {<chromium-browser>} {<konqueror>} {<opera>} {<w3m>} {<elinks>} {<links>} {<lynx>} {<dillo>} {<open>} {<start>} {<cygstart>} {<xdg-open>} ] spids: [122 201 204 -1] ) (case_arm pat_list: [{<Id.Lit_Star '*'>}] action: [ (command.AndOr ops: [Id.Op_DPipe] children: [ (C {<valid_custom_tool>} {(DQ ($ Id.VSub_Number '$1'))}) (command.ControlFlow token: <Id.ControlFlow_Return return> arg_word: {<1>} ) ] ) ] spids: [210 211 227 -1] ) ] ) ] ) ) (command.ShFunction name: init_browser_path body: (command.BraceGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:browser_path) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_DollarParen '$('> command_list: (command.CommandList children: [ (C {<git>} {<config>} {(DQ <browser.> ($ Id.VSub_Number '$1') <.path>)}) ] ) ) } spids: [242] ) ] ) (command.If arms: [ (if_arm cond: [ (command.AndOr ops: [Id.Op_DAmp Id.Op_DAmp] children: [ (C {<test>} {<-z>} {(DQ ($ Id.VSub_DollarName '$browser_path'))}) (C {<test>} {(DQ ($ Id.VSub_Number '$1'))} {<Id.Lit_Equals '='>} {<chromium>}) (command.Simple words: [{<type>} {<chromium-browser>}] redirects: [ (redir.Redir op: <Id.Redir_Great '>'> fd: -1 arg_word: {</dev/null>} ) (redir.Redir op: <Id.Redir_GreatAnd '2>&'> fd: 2 arg_word: {<1>} ) ] ) ] ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:browser_path) op: assign_op.Equal rhs: {<chromium-browser>} spids: [296] ) ] ) ] spids: [256 293] ) ] ) (C {<Id.Lit_Other ':'>} { (braced_var_sub token: <Id.VSub_Name browser_path> suffix_op: (suffix_op.Unary op_id: Id.VTest_ColonEquals arg_word: {(DQ ($ Id.VSub_Number '$1'))} ) ) } ) ] ) ) (command.WhileUntil keyword: <Id.KW_While while> cond: [(C {<test>} {($ Id.VSub_Pound '$#')} {<Id.KW_Bang '!'> <Id.Lit_Equals '='>} {<0>})] body: (command.DoGroup children: [ (command.Case to_match: {(DQ ($ Id.VSub_Number '$1'))} arms: [ (case_arm pat_list: [{<-b>} {<--browser> <Id.Lit_Star '*'>} {<-t>} {<--tool> <Id.Lit_Star '*'>}] action: [ (command.Case to_match: {(DQ ($ Id.VSub_Pound '$#') <','> ($ Id.VSub_Number '$1'))} arms: [ (case_arm pat_list: [ {<Id.Lit_Star '*'> <Id.Lit_Comma ','> <Id.Lit_Star '*'> <Id.Lit_Equals '='> <Id.Lit_Star '*'> } ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:browser) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_DollarParen '$('> command_list: (command.CommandList children: [ (C {<expr>} {(DQ <z> ($ Id.VSub_Number '$1'))} {<Id.Lit_Other ':'>} {(SQ <'z-[^=]*=\\(.*\\)'>)} ) ] ) ) } spids: [370] ) ] ) ] spids: [362 367 387 -1] ) (case_arm pat_list: [{<1> <Id.Lit_Comma ','> <Id.Lit_Star '*'>}] action: [(C {<usage>})] spids: [390 393 398 -1] ) (case_arm pat_list: [{<Id.Lit_Star '*'>}] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:browser) op: assign_op.Equal rhs: {(DQ ($ Id.VSub_Number '$2'))} spids: [405] ) ] ) (C {<shift>}) ] spids: [401 402 413 -1] ) ] ) ] spids: [339 348 419 -1] ) (case_arm pat_list: [{<-c>} {<--config> <Id.Lit_Star '*'>}] action: [ (command.Case to_match: {(DQ ($ Id.VSub_Pound '$#') <','> ($ Id.VSub_Number '$1'))} arms: [ (case_arm pat_list: [ {<Id.Lit_Star '*'> <Id.Lit_Comma ','> <Id.Lit_Star '*'> <Id.Lit_Equals '='> <Id.Lit_Star '*'> } ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:conf) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_DollarParen '$('> command_list: (command.CommandList children: [ (C {<expr>} {(DQ <z> ($ Id.VSub_Number '$1'))} {<Id.Lit_Other ':'>} {(SQ <'z-[^=]*=\\(.*\\)'>)} ) ] ) ) } spids: [448] ) ] ) ] spids: [440 445 465 -1] ) (case_arm pat_list: [{<1> <Id.Lit_Comma ','> <Id.Lit_Star '*'>}] action: [(C {<usage>})] spids: [468 471 476 -1] ) (case_arm pat_list: [{<Id.Lit_Star '*'>}] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:conf) op: assign_op.Equal rhs: {(DQ ($ Id.VSub_Number '$2'))} spids: [483] ) ] ) (C {<shift>}) ] spids: [479 480 491 -1] ) ] ) ] spids: [422 426 497 -1] ) (case_arm pat_list: [{<-->}] action: [(command.ControlFlow token:<Id.ControlFlow_Break break>)] spids: [500 501 507 -1] ) (case_arm pat_list: [{<-> <Id.Lit_Star '*'>}] action: [(C {<usage>})] spids: [510 512 518 -1] ) (case_arm pat_list: [{<Id.Lit_Star '*'>}] action: [(command.ControlFlow token:<Id.ControlFlow_Break break>)] spids: [521 522 528 -1] ) ] ) (C {<shift>}) ] ) ) (command.AndOr ops: [Id.Op_DAmp] children: [(C {<test>} {($ Id.VSub_Pound '$#')} {<Id.Lit_Equals '='>} {<0>}) (C {<usage>})] ) (command.If arms: [ (if_arm cond: [(C {<test>} {<-z>} {(DQ ($ Id.VSub_DollarName '$browser'))})] action: [ (command.ForEach iter_name: opt iter_words: [{(DQ ($ Id.VSub_DollarName '$conf'))} {(DQ <web.browser>)}] do_arg_iter: F body: (command.DoGroup children: [ (command.AndOr ops: [Id.Op_DAmp] children: [ (C {<test>} {<-z>} {(DQ ($ Id.VSub_DollarName '$opt'))}) (command.ControlFlow token: <Id.ControlFlow_Continue continue> ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:browser) op: assign_op.Equal rhs: { (DQ (command_sub left_token: <Id.Left_DollarParen '$('> command_list: (command.CommandList children: [(C {<git>} {<config>} {($ Id.VSub_DollarName '$opt')})] ) ) ) } spids: [596] ) ] ) (command.AndOr ops: [Id.Op_DPipe] children: [ (C {<test>} {<-z>} {(DQ ($ Id.VSub_DollarName '$browser'))}) (command.ControlFlow token: <Id.ControlFlow_Break break> ) ] ) ] ) ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.AndOr ops: [Id.Op_DAmp] children: [ (C {<test>} {<-n>} {(DQ ($ Id.VSub_DollarName '$browser'))}) (command.Pipeline children: [(C {<valid_tool>} {(DQ ($ Id.VSub_DollarName '$browser'))})] negated: T ) ] ) terminator: <Id.Op_Semi _> ) ] action: [ (command.Simple words: [ {<echo>} { (DQ <'git config option '> ($ Id.VSub_DollarName '$opt') <' set to unknown browser: '> ($ Id.VSub_DollarName '$browser') ) } ] redirects: [(redir.Redir op:<Id.Redir_GreatAnd '>&'> fd:-1 arg_word:{<2>})] ) (command.Simple words: [{<echo>} {(DQ <'Resetting to default...'>)}] redirects: [(redir.Redir op:<Id.Redir_GreatAnd '>&'> fd:-1 arg_word:{<2>})] ) (C {<unset>} {<browser>}) ] spids: [624 645] ) ] ) ] spids: [552 562] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {<test>} {<-z>} {(DQ ($ Id.VSub_DollarName '$browser'))}) terminator: <Id.Op_Semi _> ) ] action: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {<test>} {<-n>} {(DQ ($ Id.VSub_DollarName '$DISPLAY'))}) terminator: <Id.Op_Semi _> ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:browser_candidates) op: assign_op.Equal rhs: { (DQ < 'firefox iceweasel google-chrome chrome chromium chromium-browser konqueror opera seamonkey iceape w3m elinks links lynx dillo xdg-open' > ) } spids: [710] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {<test>} {(DQ ($ Id.VSub_DollarName '$KDE_FULL_SESSION'))} {<Id.Lit_Equals '='>} {(DQ <true>)} ) terminator: <Id.Op_Semi _> ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:browser_candidates) op: assign_op.Equal rhs: {(DQ <'konqueror '> ($ Id.VSub_DollarName '$browser_candidates'))} spids: [734] ) ] ) ] spids: [716 731] ) ] ) ] spids: [696 707] ) ] else_action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:browser_candidates) op: assign_op.Equal rhs: {(DQ <'w3m elinks links lynx'>)} spids: [747] ) ] ) ] ) (command.If arms: [ (if_arm cond: [ (command.AndOr ops: [Id.Op_DPipe] children: [ (C {<test>} {<-n>} {(DQ ($ Id.VSub_DollarName '$SECURITYSESSIONID'))}) (C {<test>} {<-n>} {(DQ ($ Id.VSub_DollarName '$TERM_PROGRAM'))}) ] ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:browser_candidates) op: assign_op.Equal rhs: {(DQ <'open '> ($ Id.VSub_DollarName '$browser_candidates'))} spids: [784] ) ] ) ] spids: [760 781] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {<test>} {<-x>} {</bin/start>}) terminator: <Id.Op_Semi _> ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:browser_candidates) op: assign_op.Equal rhs: {(DQ <'start '> ($ Id.VSub_DollarName '$browser_candidates'))} spids: [810] ) ] ) ] spids: [798 807] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {<test>} {<-x>} {</usr/bin/cygstart>}) terminator: <Id.Op_Semi _> ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:browser_candidates) op: assign_op.Equal rhs: {(DQ <'cygstart '> ($ Id.VSub_DollarName '$browser_candidates'))} spids: [836] ) ] ) ] spids: [824 833] ) ] ) (command.ForEach iter_name: i iter_words: [{($ Id.VSub_DollarName '$browser_candidates')}] do_arg_iter: F body: (command.DoGroup children: [ (C {<init_browser_path>} {($ Id.VSub_DollarName '$i')}) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.Simple words: [{<type>} {(DQ ($ Id.VSub_DollarName '$browser_path'))}] redirects: [ (redir.Redir op: <Id.Redir_Great '>'> fd: -1 arg_word: {</dev/null>} ) (redir.Redir op: <Id.Redir_GreatAnd '2>&'> fd: 2 arg_word: {<1>} ) ] ) terminator: <Id.Op_Semi _> ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:browser) op: assign_op.Equal rhs: {($ Id.VSub_DollarName '$i')} spids: [883] ) ] ) (command.ControlFlow token: <Id.ControlFlow_Break break> ) ] spids: [864 880] ) ] ) ] ) ) (command.AndOr ops: [Id.Op_DAmp] children: [ (C {<test>} {<-z>} {(DQ ($ Id.VSub_DollarName '$browser'))}) (C {<die>} {(DQ <'No known browser available.'>)}) ] ) ] spids: [681 693] ) ] else_action: [ (command.AndOr ops: [Id.Op_DPipe] children: [ (C {<valid_tool>} {(DQ ($ Id.VSub_DollarName '$browser'))}) (C {<die>} {(DQ <"Unknown browser '"> ($ Id.VSub_DollarName '$browser') <"'.">)}) ] ) (C {<init_browser_path>} {(DQ ($ Id.VSub_DollarName '$browser'))}) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.AndOr ops: [Id.Op_DAmp] children: [ (C {<test>} {<-z>} {(DQ ($ Id.VSub_DollarName '$browser_cmd'))}) (command.Pipeline children: [ (command.Simple words: [{<type>} {(DQ ($ Id.VSub_DollarName '$browser_path'))}] redirects: [ (redir.Redir op: <Id.Redir_Great '>'> fd: -1 arg_word: {</dev/null>} ) (redir.Redir op: <Id.Redir_GreatAnd '2>&'> fd: 2 arg_word: {<1>} ) ] ) ] negated: T ) ] ) terminator: <Id.Op_Semi _> ) ] action: [ (C {<die>} { (DQ <'The browser '> ($ Id.VSub_DollarName '$browser') <" is not available as '"> ($ Id.VSub_DollarName '$browser_path') <"'."> ) } ) ] spids: [941 969] ) ] ) ] ) (command.Case to_match: {(DQ ($ Id.VSub_DollarName '$browser'))} arms: [ (case_arm pat_list: [{<firefox>} {<iceweasel>} {<seamonkey>} {<iceape>}] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:vers) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_DollarParen '$('> command_list: (command.CommandList children: [ (C {<expr>} { (DQ (command_sub left_token: <Id.Left_DollarParen '$('> command_list: (command.CommandList children: [ (C {($ Id.VSub_DollarName '$browser_path')} {<-version>}) ] ) ) ) } {<Id.Lit_Other ':'>} {(SQ <'.* \\([0-9][0-9]*\\)\\..*'>)} ) ] ) ) } spids: [1010] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:NEWTAB) op: assign_op.Equal rhs: {(SQ <-new-tab>)} spids: [1030] ) ] ) (command.AndOr ops: [Id.Op_DAmp] children: [ (C {<test>} {(DQ ($ Id.VSub_DollarName '$vers'))} {<-lt>} {<2>}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:NEWTAB) op: assign_op.Equal rhs: {(SQ )} spids: [1048] ) ] ) ] ) (command.Sentence child: (C {(DQ ($ Id.VSub_DollarName '$browser_path'))} {($ Id.VSub_DollarName '$NEWTAB')} {(DQ ($ Id.VSub_At '$@'))} ) terminator: <Id.Op_Amp _> ) ] spids: [996 1003 1066 -1] ) (case_arm pat_list: [{<google-chrome>} {<chrome>} {<chromium>} {<chromium-browser>}] action: [ (command.Sentence child: (C {(DQ ($ Id.VSub_DollarName '$browser_path'))} {(DQ ($ Id.VSub_At '$@'))}) terminator: <Id.Op_Amp _> ) ] spids: [1068 1075 1093 -1] ) (case_arm pat_list: [{<konqueror>}] action: [ (command.Case to_match: { (DQ (command_sub left_token: <Id.Left_DollarParen '$('> command_list: (command.CommandList children: [(C {<basename>} {(DQ ($ Id.VSub_DollarName '$browser_path'))})] ) ) ) } arms: [ (case_arm pat_list: [{<konqueror>}] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:browser_path) op: assign_op.Equal rhs: { (DQ (command_sub left_token: <Id.Left_DollarParen '$('> command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {<echo>} {(DQ ($ Id.VSub_DollarName '$browser_path'))}) (C {<sed>} {<-e>} {(SQ <'s/konqueror$/kfmclient/'>)}) ] negated: F ) ] ) ) ) } spids: [1122] ) ] ) (command.AndOr ops: [Id.Op_DPipe] children: [ (command.Simple words: [{<type>} {(DQ ($ Id.VSub_DollarName '$browser_path'))}] redirects: [ (redir.Redir op: <Id.Redir_Great '>'> fd: -1 arg_word: {</dev/null>} ) (redir.Redir op: <Id.Redir_GreatAnd '2>&'> fd: 2 arg_word: {<1>} ) ] ) (C {<die>} {(DQ <"No '"> ($ Id.VSub_DollarName '$browser_path') <"' found.">)}) ] ) (command.Sentence child: (C {(DQ ($ Id.VSub_DollarName '$browser_path'))} {<newTab>} {(DQ ($ Id.VSub_At '$@'))} ) terminator: <Id.Op_Amp _> ) ] spids: [1114 1115 1181 -1] ) (case_arm pat_list: [{<kfmclient>}] action: [ (command.Sentence child: (C {(DQ ($ Id.VSub_DollarName '$browser_path'))} {<newTab>} {(DQ ($ Id.VSub_At '$@'))} ) terminator: <Id.Op_Amp _> ) ] spids: [1184 1185 1201 -1] ) (case_arm pat_list: [{<Id.Lit_Star '*'>}] action: [ (command.Sentence child: (C {(DQ ($ Id.VSub_DollarName '$browser_path'))} {(DQ ($ Id.VSub_At '$@'))}) terminator: <Id.Op_Amp _> ) ] spids: [1204 1205 1219 -1] ) ] ) ] spids: [1095 1096 1225 -1] ) (case_arm pat_list: [{<w3m>} {<elinks>} {<links>} {<lynx>} {<open>} {<cygstart>} {<xdg-open>}] action: [(C {(DQ ($ Id.VSub_DollarName '$browser_path'))} {(DQ ($ Id.VSub_At '$@'))})] spids: [1227 1240 1252 -1] ) (case_arm pat_list: [{<start>}] action: [ (C {<exec>} {(DQ ($ Id.VSub_DollarName '$browser_path'))} {(SQ <'"web-browse"'>)} {(DQ ($ Id.VSub_At '$@'))} ) ] spids: [1254 1255 1273 -1] ) (case_arm pat_list: [{<opera>} {<dillo>}] action: [ (command.Sentence child: (C {(DQ ($ Id.VSub_DollarName '$browser_path'))} {(DQ ($ Id.VSub_At '$@'))}) terminator: <Id.Op_Amp _> ) ] spids: [1275 1278 1292 -1] ) (case_arm pat_list: [{<Id.Lit_Star '*'>}] action: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {<test>} {<-n>} {(DQ ($ Id.VSub_DollarName '$browser_cmd'))}) terminator: <Id.Op_Semi _> ) ] action: [ (command.Subshell command_list: (command.CommandList children: [ (C {<eval>} { (DQ ($ Id.VSub_DollarName '$browser_cmd') <' '> (word_part.EscapedLiteral token: <Id.Lit_EscapedChar '\\"'> ) (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\$'>) <'@'> (word_part.EscapedLiteral token: <Id.Lit_EscapedChar '\\"'> ) ) } ) ] ) ) ] spids: [1298 1309] ) ] ) ] spids: [1294 1295 1331 -1] ) ] ) ] )