add comments to the repl package
This commit is contained in:
@@ -7,6 +7,9 @@ import (
|
||||
"github.com/LazyBachelor/LazyPM/pkg/cli/commands"
|
||||
)
|
||||
|
||||
// execute processes the input command and returns the output
|
||||
// or an error if it occurs. It handles what type of command is being executed,
|
||||
// whether it's a PM command or a shell command, and routes it accordingly.
|
||||
func execute(input string) (string, error) {
|
||||
if input == "" {
|
||||
return "", nil
|
||||
@@ -26,6 +29,8 @@ func execute(input string) (string, error) {
|
||||
return executeShellCommand(input)
|
||||
}
|
||||
|
||||
// executeShellCommand executes a shell command
|
||||
// and returns its output or an error if it occurs.
|
||||
func executeShellCommand(input string) (string, error) {
|
||||
parts := strings.Fields(input)
|
||||
if len(parts) == 0 {
|
||||
@@ -37,6 +42,8 @@ func executeShellCommand(input string) (string, error) {
|
||||
return string(output), err
|
||||
}
|
||||
|
||||
// executePMCommand executes a PM command using the commands package
|
||||
// and returns its output or an error if it occurs.
|
||||
func executePMCommand(input string) (string, error) {
|
||||
parts := strings.Fields(input)
|
||||
if len(parts) == 0 {
|
||||
|
||||
Reference in New Issue
Block a user