(par *lineTree, usage *argparseUsage, res *parseResult)
| 253 | } |
| 254 | |
| 255 | func extractPositionalArgs(par *lineTree, usage *argparseUsage, res *parseResult) bool { |
| 256 | var completions []datastore.Completion |
| 257 | for idx := range par.children[0].children { |
| 258 | line := par.children[0].children[idx].line |
| 259 | arg := argRe.FindStringSubmatch(line)[1] |
| 260 | if len(arg) == 0 { |
| 261 | return false |
| 262 | } |
| 263 | completions = append(completions, datastore.Completion{ |
| 264 | Flag: arg, |
| 265 | Context: usage.flagContext, |
| 266 | }) |
| 267 | } |
| 268 | res.completions = append(res.completions, completions...) |
| 269 | return true |
| 270 | } |
| 271 | |
| 272 | func tryParseNamedPositionalParagraph(par *lineTree, usage *argparseUsage, res *parseResult) bool { |
| 273 | if len(par.children) != 1 { |
no outgoing calls
no test coverage detected