Repository navigation
Commit e2af447
committed
completion: support comma-separated value hints
Add a hint provider registry so that flag value hints can be
populated at runtime without hardcoding values in struct tags.
Flags using a completion:"csv:<name>" tag get comma-aware
completion: already chosen values are filtered out and only the
segment after the last comma is returned, matching bash
COMP_WORDBREAKS behavior.
Signed-off-by: Robin Jarry <robin@jarry.cc>1 parent df5ede9 commit e2af447
1 file changed
Lines changed: 33 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
102 | | - | |
103 | | - | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
104 | 120 | | |
105 | 121 | | |
106 | 122 | | |
| |||
150 | 166 | | |
151 | 167 | | |
152 | 168 | | |
153 | | - | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
154 | 176 | | |
155 | | - | |
| 177 | + | |
156 | 178 | | |
157 | | - | |
158 | | - | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
159 | 182 | | |
160 | | - | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
161 | 187 | | |
162 | 188 | | |
163 | 189 | | |
| |||
0 commit comments