original_string: function handleflags($i, $argv)
      {
          if (!isset($argv[1]) || !isset(self::$_options[$argv[$i][1]])) {
              throw new Exception('Command line syntax error: undefined option "' .  $argv[$i] . '"');
          }
          $v = self::$_options[$argv[$i][1]] == '-';
          if (self::$_options[$argv[$i][1]]['type'] == self::OPT_FLAG) {
              $this->{self::$_options[$argv[$i][1]]['arg']} = 1;
          } elseif (self::$_options[$argv[$i][1]]['type'] == self::OPT_FFLAG) {
              $this->{self::$_options[$argv[$i][1]]['arg']}($v);
          } elseif (self::$_options[$argv[$i][1]]['type'] == self::OPT_FSTR) {
              $this->{self::$_options[$argv[$i][1]]['arg']}(substr($v, 2));
          } else {
              throw new Exception('Command line syntax error: missing argument on switch: "' . $argv[$i] . '"');
          }
          return 0;
      }
code: function handleflags($i, $argv)
      {
          if (!isset($argv[1]) || !isset(self::$_options[$argv[$i][1]])) {
              throw new Exception('Command line syntax error: undefined option "' .  $argv[$i] . '"');
          }
          $v = self::$_options[$argv[$i][1]] == '-';
          if (self::$_options[$argv[$i][1]]['type'] == self::OPT_FLAG) {
              $this->{self::$_options[$argv[$i][1]]['arg']} = 1;
          } elseif (self::$_options[$argv[$i][1]]['type'] == self::OPT_FFLAG) {
              $this->{self::$_options[$argv[$i][1]]['arg']}($v);
          } elseif (self::$_options[$argv[$i][1]]['type'] == self::OPT_FSTR) {
              $this->{self::$_options[$argv[$i][1]]['arg']}(substr($v, 2));
          } else {
              throw new Exception('Command line syntax error: missing argument on switch: "' . $argv[$i] . '"');
          }
          return 0;
      }
code_tokens: function handleflags ( $ i , $ argv ) { if ( ! isset ( $ argv [ 1 ] ) || ! isset ( self :: $ _options [ $ argv [ $ i ] [ 1 ] ] ) ) { throw new Exception ( 'Command line syntax error: undefined option "' . $ argv [ $ i ] . '"' ) ; } $ v = self :: $ _options [ $ argv [ $ i ] [ 1 ] ] == '-' ; if ( self :: $ _options [ $ argv [ $ i ] [ 1 ] ] [ 'type' ] == self :: OPT_FLAG ) { $ this -> { self :: $ _options [ $ argv [ $ i ] [ 1 ] ] [ 'arg' ] } = 1 ; } elseif ( self :: $ _options [ $ argv [ $ i ] [ 1 ] ] [ 'type' ] == self :: OPT_FFLAG ) { $ this -> { self :: $ _options [ $ argv [ $ i ] [ 1 ] ] [ 'arg' ] } ( $ v ) ; } elseif ( self :: $ _options [ $ argv [ $ i ] [ 1 ] ] [ 'type' ] == self :: OPT_FSTR ) { $ this -> { self :: $ _options [ $ argv [ $ i ] [ 1 ] ] [ 'arg' ] } ( substr ( $ v , 2 ) ) ; } else { throw new Exception ( 'Command line syntax error: missing argument on switch: "' . $ argv [ $ i ] . '"' ) ; } return 0 ; }
docstring: Process a flag command line argument.
  
  @param int   $i
  @param array $argv
  
  @return int
docstring_tokens: Process a flag command line argument .