feat: simplify flag parsing in apps plugin

Commands should be written such that they take arguments as is.
This commit is contained in:
Jose Diaz-Gonzalez
2020-05-09 00:44:20 -04:00
parent 6a8783e357
commit ce154aff09
6 changed files with 110 additions and 114 deletions

View File

@@ -527,6 +527,15 @@ func RightPad(str string, length int, pad string) string {
return str + times(pad, length-len(str))
}
// Shift removes the first and returns that entry as well as the rest of the list
func ShiftString(a []string) (string, []string) {
if len(a) == 0 {
return "", a
}
return a[0], a[1:]
}
// StripInlineComments removes bash-style comment from input line
func StripInlineComments(text string) string {
bytes := []byte(text)