code: func ParseCommandLine(args []string) (*CommandLine, error) {
  	noTarget := NoTarget{}
  
  	cl := CommandLine{
  		Target: noTarget,
  	}
  	i := 0
  	for len(args) > 0 {
  		// Stop parsing after we have a target, as Python does.
  		if cl.Target != noTarget {
  			break
  		}
  
  		// Consume the next argument.
  		arg := args[0]
  		args = args[1:]
  		i++
  
  		if arg == "-" {
  			// "-" instructs Python to load the script from STDIN.
  			cl.Target = ScriptTarget{
  				Path: "-",
  			}
  			continue
  		}
  
  		isFlag := false
  		if !cl.FlagSeparator {
  			arg, isFlag = trimPrefix(arg, "-")
  		}
  
  		if !isFlag {
  			// The first positional argument is the path to the script, and all
  			// subsequent arguments are script arguments.
  			cl.Target = ScriptTarget{
  				Path:             arg,
  				FollowsSeparator: cl.FlagSeparator,
  			}
  			continue
  		}
  
  		// Note that at this point we've trimmed the preceding "-" from arg, so
  		// this is really "--". If we encounter "--" that marks the end of
  		// interpreter flag parsing; everything hereafter is considered positional
  		// to the interpreter.
  		if arg == "-" {
  			cl.FlagSeparator = true
  			continue
  		}
  
  		// Parse this flag and any remainder.
  		fs := parsedFlagState{
  			flag: arg,
  			args: args,
  		}
  		for len(fs.flag) > 0 {
  			if err := cl.parseSingleFlag(&fs); err != nil {
  				return nil, errors.Annotate(err, "failed to parse Python flag #%d", i).
  					InternalReason("arg(%q)", arg).Err()
  			}
  		}
  		args = fs.args
  	}
  
  	// The remainder of arguments are for the script.
  	cl.Args = append([]string(nil), args...)
  	return &cl, nil
  }
docs: // ParseCommandLine parses Python command-line arguments and returns a
  // structured representation.