code: func Fields(cfg *Config, words ...*syntax.Word) ([]string, error) {
  	cfg = prepareConfig(cfg)
  	fields := make([]string, 0, len(words))
  	dir := cfg.envGet("PWD")
  	for _, word := range words {
  		afterBraces := []*syntax.Word{word}
  		if w2 := syntax.SplitBraces(word); w2 != word {
  			afterBraces = Braces(w2)
  		}
  		for _, word2 := range afterBraces {
  			wfields, err := cfg.wordFields(word2.Parts)
  			if err != nil {
  				return nil, err
  			}
  			for _, field := range wfields {
  				path, doGlob := cfg.escapedGlobField(field)
  				var matches []string
  				if doGlob && cfg.ReadDir != nil {
  					matches, err = cfg.glob(dir, path)
  					if err != nil {
  						return nil, err
  					}
  					if len(matches) > 0 {
  						fields = append(fields, matches...)
  						continue
  					}
  				}
  				fields = append(fields, cfg.fieldJoin(field))
  			}
  		}
  	}
  	return fields, nil
  }
docs: // Fields expands a number of words as if they were arguments in a shell
  // command. This includes brace expansion, tilde expansion, parameter expansion,
  // command substitution, arithmetic expansion, and quote removal.