mirror of
https://gitlab.com/pnx/gosh
synced 2026-06-15 23:03:09 +02:00
18 lines
305 B
Go
18 lines
305 B
Go
package parser
|
|
|
|
import (
|
|
"bufio"
|
|
"strings"
|
|
|
|
"gosh/internal/command"
|
|
)
|
|
|
|
func Parse(input string) command.Definition {
|
|
scanner := bufio.NewScanner(strings.NewReader(input))
|
|
scanner.Split(bufio.ScanWords)
|
|
args := []string{}
|
|
for scanner.Scan() {
|
|
args = append(args, scanner.Text())
|
|
}
|
|
return args
|
|
}
|