(CommandList
  children: [
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:KUBECTL_FILES)
          op: Equal
          rhs: {(DQ ('pkg/kubectl/cmd/*.go pkg/kubectl/cmd/*/*.go'))}
          spids: [44]
        )
      ]
      spids: [44]
    )
    (Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(LhsName name:generate_pot) op:Equal rhs:{(DQ (false))} spids:[50])]
      spids: [50]
    )
    (Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(LhsName name:generate_mo) op:Equal rhs:{(DQ (false))} spids:[55])]
      spids: [55]
    )
    (While
      cond: [(Sentence child:(C {(getopts)} {(DQ ('hf:xg'))} {(opt)}) terminator:<Op_Semi ';'>)]
      body: 
        (DoGroup
          children: [
            (Case
              to_match: {($ VSub_Name '$opt')}
              arms: [
                (case_arm
                  pat_list: [{(h)}]
                  action: [
                    (C {(echo)} {(DQ ($ VSub_Number '$0') (' [-f files] [-x] [-g]'))})
                    (C {(echo)} {(DQ (' -f <file-path>: Files to process'))})
                    (C {(echo)} {(DQ (' -x extract strings to a POT file'))})
                    (C {(echo)} {(DQ (' -g sort .po files and generate .mo files'))})
                    (C {(exit)} {(0)})
                  ]
                  spids: [82 83 120 16777215]
                )
                (case_arm
                  pat_list: [{(f)}]
                  action: [
                    (Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (LhsName name:KUBECTL_FILES)
                          op: Equal
                          rhs: {(DQ (${ VSub_Name OPTARG))}
                          spids: [127]
                        )
                      ]
                      spids: [127]
                    )
                  ]
                  spids: [123 124 135 16777215]
                )
                (case_arm
                  pat_list: [{(x)}]
                  action: [
                    (Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (LhsName name:generate_pot)
                          op: Equal
                          rhs: {(DQ (true))}
                          spids: [142]
                        )
                      ]
                      spids: [142]
                    )
                  ]
                  spids: [138 139 148 16777215]
                )
                (case_arm
                  pat_list: [{(g)}]
                  action: [
                    (Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (LhsName name:generate_mo)
                          op: Equal
                          rhs: {(DQ (true))}
                          spids: [155]
                        )
                      ]
                      spids: [155]
                    )
                  ]
                  spids: [151 152 161 16777215]
                )
                (case_arm
                  pat_list: [{(EscapedLiteralPart token:<Lit_EscapedChar '\\?'>)}]
                  action: [
                    (SimpleCommand
                      words: [{(echo)} {(DQ ('[-f <files>] -x -g'))}]
                      redirects: [(Redir op_id:Redir_GreatAnd fd:16777215 arg_word:{(2)} spids:[174])]
                    )
                    (C {(exit)} {(1)})
                  ]
                  spids: [164 165 183 16777215]
                )
              ]
              spids: [75 79 186]
            )
          ]
          spids: [72 188]
        )
    )
    (If
      arms: [
        (if_arm
          cond: [
            (Sentence
              child: 
                (Pipeline
                  children: [
                    (SimpleCommand
                      words: [{(which)} {(go-xgettext)}]
                      redirects: [
                        (Redir
                          op_id: Redir_Great
                          fd: 16777215
                          arg_word: {(/dev/null)}
                          spids: [199]
                        )
                      ]
                    )
                  ]
                  negated: True
                )
              terminator: <Op_Semi ';'>
            )
          ]
          action: [
            (C {(echo)} {(SQ <'Can not find go-xgettext, install with:'>)})
            (C {(echo)} {(SQ <'go get github.com/gosexy/gettext/go-xgettext'>)})
            (C {(exit)} {(1)})
          ]
          spids: [16777215 204]
        )
      ]
      spids: [16777215 225]
    )
    (If
      arms: [
        (if_arm
          cond: [
            (Sentence
              child: 
                (Pipeline
                  children: [
                    (SimpleCommand
                      words: [{(which)} {(msgfmt)}]
                      redirects: [
                        (Redir
                          op_id: Redir_Great
                          fd: 16777215
                          arg_word: {(/dev/null)}
                          spids: [236]
                        )
                      ]
                    )
                  ]
                  negated: True
                )
              terminator: <Op_Semi ';'>
            )
          ]
          action: [
            (C {(echo)} {(SQ <'Can not find msgfmt, install with:'>)})
            (C {(echo)} {(SQ <'apt-get install gettext'>)})
            (C {(exit)} {(1)})
          ]
          spids: [16777215 241]
        )
      ]
      spids: [16777215 262]
    )
    (If
      arms: [
        (if_arm
          cond: [
            (Sentence
              child: 
                (DBracket
                  expr: 
                    (BoolBinary
                      op_id: BoolBinary_GlobDEqual
                      left: {(DQ (${ VSub_Name generate_pot))}
                      right: {(DQ (true))}
                    )
                )
              terminator: <Op_Semi ';'>
            )
          ]
          action: [
            (C {(echo)} {(DQ ('Extracting strings to POT'))})
            (SimpleCommand
              words: [{(go-xgettext)} {(-k) (Lit_Other '=') (i18n.T)} {(${ VSub_Name KUBECTL_FILES)}]
              redirects: [(Redir op_id:Redir_Great fd:16777215 arg_word:{(tmp.pot)} spids:[304])]
            )
            (C {(perl)} {(-pi)} {(-e)} {(SQ <s/CHARSET/UTF-8/>)} {(tmp.pot)})
            (C {(perl)} {(-pi)} {(-e)} {(SQ <'s/\\\\\\(/\\\\\\\\\\(/g'>)} {(tmp.pot)})
            (C {(perl)} {(-pi)} {(-e)} {(SQ <'s/\\\\\\)/\\\\\\\\\\)/g'>)} {(tmp.pot)})
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (SimpleCommand
                          words: [{(msgcat)} {(-s)} {(tmp.pot)}]
                          redirects: [
                            (Redir
                              op_id: Redir_Great
                              fd: 16777215
                              arg_word: {(/tmp/template.pot)}
                              spids: [356]
                            )
                          ]
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (C {(mv)} {(/tmp/template.pot)} {(translations/kubectl/template.pot)})
                    (C {(rm)} {(tmp.pot)})
                  ]
                  spids: [16777215 361]
                )
              ]
              else_action: [(C {(echo)} {(DQ ('Failed to update template.pot'))}) (C {(exit)} {(1)})]
              spids: [376 391]
            )
          ]
          spids: [16777215 284]
        )
      ]
      spids: [16777215 393]
    )
    (If
      arms: [
        (if_arm
          cond: [
            (Sentence
              child: 
                (DBracket
                  expr: 
                    (BoolBinary
                      op_id: BoolBinary_GlobDEqual
                      left: {(DQ (${ VSub_Name generate_mo))}
                      right: {(DQ (true))}
                    )
                )
              terminator: <Op_Semi ';'>
            )
          ]
          action: [
            (C {(echo)} {(DQ ('Generating .po and .mo files'))})
            (ForEach
              iter_name: x
              iter_words: [
                {(translations/) (Lit_Other '*') (/) (Lit_Other '*') (/) (Lit_Other '*') (/) 
                  (Lit_Other '*') (.po)
                }
              ]
              do_arg_iter: False
              body: 
                (DoGroup
                  children: [
                    (SimpleCommand
                      words: [{(msgcat)} {(-s)} {($ VSub_Name '$x')}]
                      redirects: [
                        (Redir
                          op_id: Redir_Great
                          fd: 16777215
                          arg_word: {(tmp.po)}
                          spids: [451]
                        )
                      ]
                    )
                    (C {(mv)} {(tmp.po)} {($ VSub_Name '$x')})
                    (C {(echo)} {(DQ ('generating .mo file for: ') ($ VSub_Name '$x'))})
                    (C {(msgfmt)} {($ VSub_Name '$x')} {(-o)} 
                      {
                        (DQ 
                          (CommandSubPart
                            command_list: 
                              (CommandList
                                children: [(C {(dirname)} {($ VSub_Name '$x')})]
                              )
                            left_token: <Left_CommandSub '$('>
                            spids: [478 482]
                          ) (/) 
                          (CommandSubPart
                            command_list: 
                              (CommandList
                                children: [(C {(basename)} {($ VSub_Name '$x')} {(.po)})]
                              )
                            left_token: <Left_CommandSub '$('>
                            spids: [484 490]
                          ) (.mo)
                        )
                      }
                    )
                  ]
                  spids: [442 495]
                )
              spids: [430 440]
            )
          ]
          spids: [16777215 415]
        )
      ]
      spids: [16777215 497]
    )
    (C {(./hack/generate-bindata.sh)})
  ]
)