Skip to content

Commit 14fffe7

Browse files
committed
Expose context map keys
1 parent 795ad79 commit 14fffe7

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

context.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,14 @@ func (c *Context) Del(key string) {
4444
delete(c.values, key)
4545
}
4646

47+
// Keys returns all keys in the context.
48+
func (c *Context) Keys() (keys []string) {
49+
for key := range c.values {
50+
keys = append(keys, key)
51+
}
52+
return
53+
}
54+
4755
// ProgressBar returns the progress bar for the current shell context.
4856
func (c *Context) ProgressBar() ProgressBar {
4957
return c.progressBar

0 commit comments

Comments
 (0)