Skip to content

Commit 454a3ce

Browse files
committed
Add cli documentation.
1 parent 8460c9c commit 454a3ce

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed

cmd/semtech-bridge/doc.go

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/*
2+
NAME:
3+
semtech-bridge - Semtech UDP protocol speaking gateway <-> MQTT
4+
5+
USAGE:
6+
main [global options] command [command options] [arguments...]
7+
8+
COMMANDS:
9+
help, h Shows a list of commands or help for one command
10+
11+
GLOBAL OPTIONS:
12+
--udp-bind "0.0.0.0:1700" ip:port to bind the UDP listener to [$UDP_BIND]
13+
--mqtt-server "tcp://127.0.0.1:1883" MQTT server [$MQTT_SERVER]
14+
--mqtt-username MQTT username [$MQTT_USERNAME]
15+
--mqtt-password MQTT password [$MQTT_PASSWORD]
16+
--help, -h show help
17+
--version, -v print the version
18+
19+
20+
*/
21+
package main

cmd/semtech-bridge/doc.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bash
2+
3+
echo '/*' > doc.go
4+
go run main.go help >> doc.go
5+
echo >> doc.go
6+
echo '*/' >> doc.go
7+
echo -e "package main" >> doc.go

cmd/semtech-bridge/main.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package main
22

3+
//go:generate ./doc.sh
4+
35
import (
46
"os"
57
"os/signal"

0 commit comments

Comments
 (0)