Skip to content

Instantly share code, notes, and snippets.

@frrist
Created November 21, 2017 22:24
Show Gist options
  • Save frrist/000047fffaf7adaa93abf37333fdb5c1 to your computer and use it in GitHub Desktop.
Save frrist/000047fffaf7adaa93abf37333fdb5c1 to your computer and use it in GitHub Desktop.
This should print something..
diff --git a/commands/reqlog.go b/commands/reqlog.go
index f9191d5dd..dc8c32d2f 100644
--- a/commands/reqlog.go
+++ b/commands/reqlog.go
@@ -12,6 +12,7 @@ type ReqLogEntry struct {
EndTime time.Time
Active bool
Command string
+ RequestId string
Options map[string]interface{}
Args []string
ID int
@@ -40,6 +41,7 @@ func (rl *ReqLog) Add(req Request) *ReqLogEntry {
StartTime: time.Now(),
Active: true,
Command: strings.Join(req.Path(), "/"),
+ RequestId: "WhyWontYouLoveMe",
Options: req.Options(),
Args: req.StringArguments(),
ID: rl.nextID,
diff --git a/core/commands/active.go b/core/commands/active.go
index e9c0b7176..f6e9c10c7 100644
--- a/core/commands/active.go
+++ b/core/commands/active.go
@@ -54,7 +54,7 @@ Lists running and recently run commands.
if verbose {
fmt.Fprint(w, "Arguments\tOptions\t")
}
- fmt.Fprintln(w, "Active\tStartTime\tRunTime")
+ fmt.Fprintln(w, "Active\tStartTime\tRunTime\tRequestId")
for _, req := range *out {
if verbose {
@@ -82,7 +82,7 @@ Lists running and recently run commands.
live = req.EndTime.Sub(req.StartTime)
}
t := req.StartTime.Format(time.Stamp)
- fmt.Fprintf(w, "%t\t%s\t%s\n", req.Active, t, live)
+ fmt.Fprintf(w, "%t\t%s\t%s\t%s\n", req.Active, t, live, req.RequestId)
}
w.Flush()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment