Skip to content

Commit

Permalink
Improve usage text for position command
Browse files Browse the repository at this point in the history
Closes #65
  • Loading branch information
martinhpedersen committed Oct 12, 2016
1 parent dde1fb8 commit 87beaae
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
7 changes: 4 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,10 @@ var commands = []Command{
Desc: "Post a position report (GPSd or manual entry).",
Usage: "[options]",
Options: map[string]string{
"--latlon": "latitude,longitude for manual entry. Will use GPSd if this is empty.",
"--latlon": "latitude,longitude in decimal degrees for manual entry. Will use GPSd if this is empty.",
"--comment, -c": "Comment to be included in the position report.",
},
Example: ExamplePosition,
HandleFunc: posReportHandle,
},
{
Expand Down Expand Up @@ -679,8 +680,8 @@ func posReportHandle(args []string) {
var latlon, comment string

set := pflag.NewFlagSet("position", pflag.ExitOnError)
set.StringVar(&latlon, "latlon", "", "latitude,longitude for manual entry")
set.StringVarP(&comment, "comment", "c", "", "Comment")
set.StringVar(&latlon, "latlon", "", "")
set.StringVarP(&comment, "comment", "c", "", "")
set.Parse(args)

report := catalog.PosReport{Comment: comment}
Expand Down
15 changes: 13 additions & 2 deletions usage.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

package main

var UsageConnect = `'alias' or 'transport://[host][/digi]/targetcall[?params...]'
var (
UsageConnect = `'alias' or 'transport://[host][/digi]/targetcall[?params...]'
transport:
winmor: WINMOR TNC
Expand All @@ -28,7 +29,7 @@ params:
?freq= Sets QSY frequency (winmor, ardop and ax25 only)
?host= Overrides the host part of the path. Useful for serial-tnc to specify e.g. /dev/ttyS0.
`
var ExampleConnect = `
ExampleConnect = `
connect telnet (alias) Connect to one of the Winlink Common Message Servers via tcp.
connect ax25:///LA1B-10 Connect to the RMS Gateway LA1B-10 using Linux AX.25 on the default axport.
connect ax25://tmd710/LA1B-10 Connect to the RMS Gateway LA1B-10 using Linux AX.25 on axport 'tmd710'.
Expand All @@ -39,3 +40,13 @@ var ExampleConnect = `
connect ardop:///LA3F?freq=5350 Same as above, but set dial frequency of the radio using rigcontrol.
connect serial-tnc:///LA1B-10 Connect to the RMS Gateway LA1B-10 over a AX.25 serial TNC on the default serial port.
`
)

var (
ExamplePosition = `
position -c "QRV 145.500MHz" Send position and comment with coordinates retrieved from GPSd.
position --latlon 59.123,005.123 Send position 59.123N 005.123E.
position --latlon 40.704,-73.945 Send position 40.704N 073.945W.
position --latlon -10.123,-60.123 Send position 10.123S 060.123W.
`
)

0 comments on commit 87beaae

Please sign in to comment.