<p>neels has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-hlr/+/16262">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">vty: show subscriber: show lu d,h,m,s ago, not just seconds<br><br>Change-Id: I0fe34e0f065160ef959b2b7b4dd040f3f2985f43<br>---<br>M src/hlr_vty_subscr.c<br>1 file changed, 14 insertions(+), 2 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/62/16262/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/hlr_vty_subscr.c b/src/hlr_vty_subscr.c</span><br><span>index 0512ff6..dfbf72f 100644</span><br><span>--- a/src/hlr_vty_subscr.c</span><br><span>+++ b/src/hlr_vty_subscr.c</span><br><span>@@ -57,8 +57,20 @@</span><br><span>        vty_out(vty, "    last LU seen on %s: %s", domain_label, get_datestr(&last_lu_seen, datebuf, sizeof(datebuf)));</span><br><span>        if (!timestamp_age(&last_lu_seen, &age))</span><br><span>             vty_out(vty, " (invalid timestamp)%s", VTY_NEWLINE);</span><br><span style="color: hsl(0, 100%, 40%);">-  else</span><br><span style="color: hsl(0, 100%, 40%);">-            vty_out(vty, " (%us ago)%s", age, VTY_NEWLINE);</span><br><span style="color: hsl(120, 100%, 40%);">+     else {</span><br><span style="color: hsl(120, 100%, 40%);">+                vty_out(vty, " (");</span><br><span style="color: hsl(120, 100%, 40%);">+#define UNIT_AGO(UNITNAME, UNITVAL) \</span><br><span style="color: hsl(120, 100%, 40%);">+          if (age >= (UNITVAL)) { \</span><br><span style="color: hsl(120, 100%, 40%);">+                  vty_out(vty, "%u%s", age / (UNITVAL), UNITNAME); \</span><br><span style="color: hsl(120, 100%, 40%);">+                  age = age % (UNITVAL); \</span><br><span style="color: hsl(120, 100%, 40%);">+              }</span><br><span style="color: hsl(120, 100%, 40%);">+             UNIT_AGO("d", 60*60*24);</span><br><span style="color: hsl(120, 100%, 40%);">+            UNIT_AGO("h", 60*60);</span><br><span style="color: hsl(120, 100%, 40%);">+               UNIT_AGO("m", 60);</span><br><span style="color: hsl(120, 100%, 40%);">+          UNIT_AGO("s", 1);</span><br><span style="color: hsl(120, 100%, 40%);">+           vty_out(vty, " ago)%s", VTY_NEWLINE);</span><br><span style="color: hsl(120, 100%, 40%);">+#undef UNIT_AGO</span><br><span style="color: hsl(120, 100%, 40%);">+      }</span><br><span> }</span><br><span> </span><br><span> static void subscr_dump_full_vty(struct vty *vty, struct hlr_subscriber *subscr)</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-hlr/+/16262">change 16262</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/osmo-hlr/+/16262"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-hlr </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I0fe34e0f065160ef959b2b7b4dd040f3f2985f43 </div>
<div style="display:none"> Gerrit-Change-Number: 16262 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: neels <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>