Skip to content

Commit bed254e

Browse files
aaronshurleyflawedmatrix
authored andcommitted
Provide usage example for publish_to_nats
[#144825355] Signed-off-by: Edwin Xie <[email protected]>
1 parent 6f77fa1 commit bed254e

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

jobs/gorouter/templates/publish_to_nats.erb

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#!/bin/bash
22

3-
set -x
4-
53
<%
64
begin
75
nats_ip = nil
@@ -36,7 +34,15 @@ rescue
3634
end
3735
%>
3836

39-
: ${2?"Usage: publish_to_nats subject message"}
37+
read -r -d '' usage <<'EOF'
38+
wrong number of arguments
39+
Usage: publish_to_nats subject message
40+
Example: publish_to_nats router.register '{"host":"172.217.6.68","port":80,"uris":["bar.example.com"]}'
41+
EOF
42+
43+
set -eux -o pipefail
44+
45+
: ${2?"${usage}"}
4046

4147
export SUBJECT=$1
4248
export MESSAGE=$2

0 commit comments

Comments
 (0)