From a69742c81c7d46a71adce5d39da28a5b839d5716 Mon Sep 17 00:00:00 2001 From: tjp Date: Wed, 10 Jan 2024 11:02:57 -0700 Subject: cli goodies -h to print "help cli" output -c CMDS to run commands in quiet mode and then exit execute with URL as positional argument to go there and start the interactive session --- help.go | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'help.go') diff --git a/help.go b/help.go index 3d5cd88..ba45cf0 100644 --- a/help.go +++ b/help.go @@ -26,8 +26,9 @@ var helpTopics = map[string]string{ "topics": ` help topics ----------- -commands: Basics of x-1 commands, and a full listing of them. Each - command also has its own help topic. +commands: Basics of x-1 commands, and a full listing of them. Each command + also has its own help topic. +cli: Flags and options available when invoking x-1 on the command line. urls: The forms of URLs which can be entered into x-1 commands. mark: Information on the bookmarks and the "mark" meta-command. tour: Information about tours and the "tour" meta-command. @@ -60,6 +61,22 @@ Typing just any URL is interpreted as a "go" command to that URL. See "help urls" for more information on forms of allowed URLs. Consult "help COMMAND" for more information on any single command. +`[1:], + + "cli": ` +x-1 [-c COMMANDS] [URL] +----------------------- +With no arguments or flags, x-1 will just display the prompt and begin +executing your commands. Use the "help" command to begin exploring this +interactive mode. + +With the -c flag, it will execute the provided commands (multiple may be +provided by separating them with a semi-colon ';') and then exit. In +this mode it also forces quiet mode, in which it doesn't automatically +print loaded pages. + +With a URL argument, it will begin an interactive prompt session by +loading the requested url. `[1:], "urls": ` -- cgit v1.2.3