Skip to content
This repository has been archived by the owner on Jun 12, 2021. It is now read-only.

Commit

Permalink
added env module
Browse files Browse the repository at this point in the history
  • Loading branch information
reujab committed Jul 20, 2017
1 parent 3cd89db commit 99974d0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
15 changes: 15 additions & 0 deletions env.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package main

import (
"os"

. "github.com/reujab/bronze/types"
)

func envSegment(segment *Segment, args []string) {
if len(args) != 1 {
dief("env: expected exactly one argument")
}

segment.Value = os.Getenv(args[0])
}
2 changes: 2 additions & 0 deletions modules.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ func handleModule(module string, segment *Segment, args []string) {
cmdTimeSegment(segment)
case "time":
timeSegment(segment)
case "env":
envSegment(segment, args)
case "plugin":
pluginSegment(segment, args)
default:
Expand Down

0 comments on commit 99974d0

Please sign in to comment.