Skip to content

Commit 97783bc

Browse files
authored
Merge pull request #13 from ajbozarth/collections
2 parents c6caf54 + 46e2d8a commit 97783bc

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/interactive.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ func getAvailableCollections(vdbName string) ([]string, error) {
211211

212212
for _, line := range lines {
213213
line = strings.TrimSpace(line)
214-
if line != "" && !strings.HasPrefix(line, "Found") && !strings.HasPrefix(line, "Collections") {
214+
if line != "" && line != "[" && line != "]" && !strings.HasPrefix(line, "Found") && !strings.HasPrefix(line, "Collections") {
215215
// Extract collection name from the line
216216
// Assuming format like "1. collection_name" or just "collection_name"
217217
if strings.Contains(line, ". ") {
@@ -220,7 +220,7 @@ func getAvailableCollections(vdbName string) ([]string, error) {
220220
collections = append(collections, strings.TrimSpace(parts[1]))
221221
}
222222
} else {
223-
collections = append(collections, line)
223+
collections = append(collections, strings.Trim(line, "\""))
224224
}
225225
}
226226
}

src/status.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,14 +105,14 @@ func showStatus(vdbName string) error {
105105
var collections []string
106106
for _, line := range lines {
107107
line = strings.TrimSpace(line)
108-
if line != "" && !strings.HasPrefix(line, "Found") && !strings.HasPrefix(line, "Collections") {
108+
if line != "" && line != "[" && line != "]" && !strings.HasPrefix(line, "Found") && !strings.HasPrefix(line, "Collections") {
109109
if strings.Contains(line, ". ") {
110110
parts := strings.SplitN(line, ". ", 2)
111111
if len(parts) > 1 {
112112
collections = append(collections, strings.TrimSpace(parts[1]))
113113
}
114114
} else {
115-
collections = append(collections, line)
115+
collections = append(collections, strings.Trim(line, "\""))
116116
}
117117
}
118118
}

0 commit comments

Comments
 (0)