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

Commit

Permalink
httpd: allow setting of unique string format
Browse files Browse the repository at this point in the history
Allow setting of unique string format from the command line.
  • Loading branch information
TheCount committed Apr 26, 2017
1 parent e1188da commit 52ac209
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/github.com/gonium/gosdm630/cmd/sdm630_httpd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,17 @@ func main() {
Usage: `MODBUS device ID to query, separated by comma.
Example: -d 11,12,13`,
},
cli.StringFlag{
Name: "unique_id_format, f",
Value: "Instrument%d",
Usage: `Unique ID format.
Example: -f Instrument%d
The %d is replaced by the device ID`,
},
}
app.Action = func(c *cli.Context) {
// Set unique ID format
sdm630.UniqueIdFormat = c.String("unique_id_format")
// Parse the device_list parameter
deviceslice := strings.Split(c.String("device_list"), ",")
devids := make([]uint8, 0, len(deviceslice))
Expand Down

0 comments on commit 52ac209

Please sign in to comment.