parsecommand.go
parsecommand.go - Overview
This file provides a utility function to parse a command string into a slice of arguments, handling quoted strings.
Detailed Documentation
ParseCommand(cmd string) []string
- Purpose: Parses a command string into a slice of arguments, handling quoted strings.
- Parameters:
cmd
:string
- The command string to parse.
- Returns:
[]string
- A slice of strings representing the parsed arguments. Quotes are removed from the arguments.
trimQuotes(s string) string
- Purpose: Removes leading and trailing quotes from a string, if they exist.
- Parameters:
s
:string
- The string to trim.
- Returns:
string
- The string with quotes removed.