cli

package
v0.19.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 20, 2025 License: MIT Imports: 35 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AccountUsage = `property [value]

properties:
  password.recovery.email
`
	AccountExample = `` /* 232-byte string literal not displayed */

)
View Source
const (
	UsageConnect = `` /* 1566-byte string literal not displayed */

	ExampleConnect = `` /* 914-byte string literal not displayed */

)
View Source
const (
	MPSUsage = `` /* 240-byte string literal not displayed */

	MPSExample = `` /* 216-byte string literal not displayed */

)
View Source
const (
	TemplatesUsage = `` /* 153-byte string literal not displayed */

	TemplatesExample = `` /* 135-byte string literal not displayed */

)

Variables

View Source
var Commands = []app.Command{
	{
		Str:        "init",
		Desc:       "Initial configuration setup.",
		HandleFunc: InitHandle,
		Usage:      "Interactive basic setup with Winlink account verification.",
	},
	{
		Str:        "configure",
		Desc:       "Open configuration file for editing.",
		HandleFunc: ConfigureHandle,
	},
	{
		Str:        "connect",
		Desc:       "Connect to a remote station.",
		HandleFunc: ConnectHandle,
		Usage:      UsageConnect,
		Example:    ExampleConnect,
		MayConnect: true,
	},
	{
		Str:   "interactive",
		Desc:  "Run interactive mode.",
		Usage: "[options]",
		Options: map[string]string{
			"--http, -h": "Start http server for web UI in the background.",
		},
		HandleFunc: InteractiveHandle,
		MayConnect: true,
		LongLived:  true,
	},
	{
		Str:   "http",
		Desc:  "Run http server for web UI.",
		Usage: "[options]",
		Options: map[string]string{
			"--addr, -a": "Listen address. Default is :8080.",
		},
		HandleFunc: HTTPHandle,
		MayConnect: true,
		LongLived:  true,
	},
	{
		Str:  "compose",
		Desc: "Compose a new message.",
		Usage: "[options]\n" +
			"\tIf no options are passed, composes interactively.\n" +
			"\tIf options are passed, reads message from stdin similar to mail(1).",
		Options: map[string]string{
			"--from, -r":        "Address to send from. Default is your call from config or --mycall, but can be specified to use tactical addresses.",
			"--forward":         "Forward given message (full path or mid)",
			"--in-reply-to":     "Compose in reply to given message (full path or mid)",
			"--reply-all":       "Reply to all (only applicable in combination with --in-reply-to)",
			"--template":        "Compose using template file. Uses the --forms directory as root for relative paths.",
			"--subject, -s":     "Subject",
			"--attachment , -a": "Attachment path (may be repeated)",
			"--cc, -c":          "CC Address(es) (may be repeated)",
			"--p2p-only":        "Send over peer to peer links only (avoid CMS)",
			"":                  "Recipient address (may be repeated)",
		},
		HandleFunc: ComposeMessage,
	},
	{
		Str:        "read",
		Desc:       "Read messages.",
		HandleFunc: ReadHandle,
	},
	{
		Str:     "composeform",
		Aliases: []string{"formPath"},
		Desc:    "Post form-based report. (DEPRECATED)",
		Usage:   "[options]",
		Options: map[string]string{
			"--template": "path to the form template file. Uses the --forms directory as root. Defaults to 'ICS USA Forms/ICS213.txt'",
		},
		HandleFunc: func(ctx context.Context, app *app.App, args []string) {
			log.Println("DEPRECATED: Use `compose --template` instead")
			if len(args) == 0 || args[0] == "" {
				args = []string{"ICS USA Forms/ICS213.txt"}
			}
			ComposeMessage(ctx, app, append([]string{"--template"}, args...))
		},
	},
	{
		Str:     "position",
		Aliases: []string{"pos"},
		Desc:    "Post a position report (GPSd or manual entry).",
		Usage:   "[options]",
		Options: map[string]string{
			"--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: PositionHandle,
	},
	{
		Str:        "extract",
		Desc:       "Extract attachments from a message file.",
		Usage:      "[full path or mid]",
		HandleFunc: ExtractMessageHandle,
	},
	{
		Str:   "rmslist",
		Desc:  "Print/search in list of RMS nodes.",
		Usage: "[options] [search term]",
		Options: map[string]string{
			"--mode, -m":              "Mode filter.",
			"--band, -b":              "Band filter (e.g. '80m').",
			"--force-download, -d":    "Force download of latest list from winlink.org.",
			"--sort-distance, -s":     "Sort by distance",
			"--sort-link-quality, -q": "Sort by predicted link quality (requires VOACAP)",
		},
		HandleFunc: RMSListHandle,
	},
	{
		Str:  "updateforms",
		Desc: "Download the latest form templates. (DEPRECATED)",
		HandleFunc: func(ctx context.Context, a *app.App, args []string) {
			log.Println("DEPRECATED: Use `templates update` instead")
			TemplatesHandle(ctx, a, []string{"update"})
		},
	},
	{
		Str:        "templates",
		Desc:       "Manage message templates and HTML forms.",
		Usage:      TemplatesUsage,
		Example:    TemplatesExample,
		HandleFunc: TemplatesHandle,
	},
	{
		Str:        "account",
		Desc:       "Get and set Winlink.org account settings.",
		Usage:      AccountUsage,
		Example:    AccountExample,
		HandleFunc: AccountHandle,
	},
	{
		Str:        "mps",
		Desc:       "Manage message pickup stations.",
		Usage:      MPSUsage,
		Example:    MPSExample,
		HandleFunc: MPSHandle,
	},
	{
		Str:   "version",
		Desc:  "Print the application version.",
		Usage: "[options]",
		Options: map[string]string{
			"--check, -c":   "Check if a new version is available",
			"--verbose, -v": "Show detailed build information",
		},
		HandleFunc: VersionHandle,
	},
	{
		Str:        "env",
		Desc:       "List environment variables.",
		HandleFunc: EnvHandle,
	},
	{
		Str:  "help",
		Desc: "Print detailed help for a given command.",
	},
}
View Source
var ExamplePosition = `` /* 309-byte string literal not displayed */

Functions

func AccountHandle

func AccountHandle(ctx context.Context, app *app.App, args []string)

func ComposeMessage

func ComposeMessage(ctx context.Context, app *app.App, args []string)

func ConfigureHandle

func ConfigureHandle(ctx context.Context, a *app.App, args []string)

func ConnectHandle

func ConnectHandle(_ context.Context, app *app.App, args []string)

func CourseFromFloat64

func CourseFromFloat64(f float64, magnetic bool) catalog.Course

func EnvHandle

func EnvHandle(_ context.Context, app *app.App, _ []string)

func ExtractMessageHandle

func ExtractMessageHandle(_ context.Context, app *app.App, args []string)

func FindCommand

func FindCommand(args []string) (cmd app.Command, pre, post []string, err error)

func HTTPHandle

func HTTPHandle(ctx context.Context, a *app.App, args []string)

func HelpHandle

func HelpHandle(args []string)

func InitHandle

func InitHandle(ctx context.Context, a *app.App, args []string)

func Interactive

func Interactive(ctx context.Context, a *app.App)

func InteractiveHandle

func InteractiveHandle(ctx context.Context, a *app.App, args []string)

func MPSHandle

func MPSHandle(ctx context.Context, a *app.App, args []string)

func PositionHandle

func PositionHandle(ctx context.Context, app *app.App, args []string)

func PrintHeard

func PrintHeard(a *app.App)

func PrintQTC

func PrintQTC(a *app.App)

func RMSListHandle

func RMSListHandle(ctx context.Context, a *app.App, args []string)

func ReadHandle

func ReadHandle(ctx context.Context, app *app.App, _ []string)

func SplitFunc

func SplitFunc(c rune) bool

func TemplatesHandle

func TemplatesHandle(ctx context.Context, app *app.App, args []string)

func VersionHandle

func VersionHandle(ctx context.Context, app *app.App, args []string)

Types

type Job

type Job struct {
	// contains filtered or unexported fields
}

type TerminalPrompter

type TerminalPrompter struct{}

func (TerminalPrompter) Prompt

func (t TerminalPrompter) Prompt(prompt app.Prompt)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL