diff options
| author | JP Appel <jeanpierre.appel01@gmail.com> | 2025-06-26 19:58:48 -0400 |
|---|---|---|
| committer | JP Appel <jeanpierre.appel01@gmail.com> | 2025-06-26 19:58:48 -0400 |
| commit | dd431b36c21b4a909d3ae0a12a4e607d326ac3cc (patch) | |
| tree | 5e7e3096d7202ce5dcdf4fc2c2eeb4b8ce23bae0 /pkg | |
| parent | f2b5e62e54edce872ddc5cc0cd8fc47251ed29c2 (diff) | |
Add support commented lines in shell
Diffstat (limited to 'pkg')
| -rw-r--r-- | pkg/data/put.go | 1 | ||||
| -rw-r--r-- | pkg/shell/interpreter.go | 7 |
2 files changed, 7 insertions, 1 deletions
diff --git a/pkg/data/put.go b/pkg/data/put.go index a5237ae..e0185ae 100644 --- a/pkg/data/put.go +++ b/pkg/data/put.go @@ -400,6 +400,5 @@ func (p PutMany) authors(ctx context.Context) error { return err } - fmt.Println("encountered no errors!") return nil } diff --git a/pkg/shell/interpreter.go b/pkg/shell/interpreter.go index 3f43f1c..2752512 100644 --- a/pkg/shell/interpreter.go +++ b/pkg/shell/interpreter.go @@ -14,6 +14,8 @@ import ( "golang.org/x/term" ) +const COMMENT_STR = "#" + type Interpreter struct { State State Workers uint @@ -315,6 +317,11 @@ out: func (inter Interpreter) Tokenize(line string) []IToken { var prevType ITokType tokens := make([]IToken, 0, 3) + + if line[:len(COMMENT_STR)] == COMMENT_STR { + return tokens + } + for word := range strings.SplitSeq(line, " ") { trimmedWord := strings.TrimSpace(word) if trimmedWord == "" { |
