1
0
Fork 0

Initial commit

This commit is contained in:
Henrik Hautakoski 2025-10-26 23:49:09 +01:00
commit 9d9d8ce7d5
19 changed files with 399 additions and 0 deletions

3
internal/parser/doc.go Normal file
View file

@ -0,0 +1,3 @@
// Package parser tokenizes raw user input and converts it into a
// command.Definition for subsequent execution.
package parser

18
internal/parser/parse.go Normal file
View file

@ -0,0 +1,18 @@
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
}