aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Okay <okay@toyful.space>2022-03-13 09:58:09 -0500
committerColin Okay <okay@toyful.space>2022-03-13 09:58:09 -0500
commitf39523d713c538f81d6f0cdc056fa750ae8a257e (patch)
tree59333340abd6a6f5a33b70aa287d74ee77e6f7e2
parent67ea50250aefe30d0e40e0fe0318a9e4d814c16e (diff)
rewrote clon synopsis form
-rw-r--r--app/app.lisp147
1 files changed, 76 insertions, 71 deletions
diff --git a/app/app.lisp b/app/app.lisp
index 32f3ad2..ff8322c 100644
--- a/app/app.lisp
+++ b/app/app.lisp
@@ -84,91 +84,95 @@ export EDITOR=/usr/bin/zile
;;; CLON SYNOPSIS DEFINITION
-(defsynopsis (:postfix "[ARGUMENTS ...]")
- (group (:header "SEARCH OPTIONS")
- (text :contents "By default, ARGUMENTS are interpeted as search terms for oneliners. For example:")
- (text :contents "$ ol grep awk # search for oneliners involving both grep and awk")
+(defsynopsis (:postfix "COMMAND [ARGS...]")
+ (group (:header "SEARCHING FOR ONELINERS" :hidden t)
(text :contents " ")
-
- (lispobj :long-name "limit"
+ (text :contents "Usage: ol [OPTIONS] search [TERMS...]")
+ (text :contents "Search for oneliners that have been tagged with all of TERMS")
+ (text :contents "E.g. `ol search grep awk`")
+ (text :contents " ")
+ (text :contents "Options include:")
+ (lispobj :long-name "limit"
:argument-type :optional
:argument-name "NUMBER"
:default-value 10
:description "The maximum number of results to return."
:typespec 'integer)
(flag :long-name "all-flagged"
- :description "Request that only flagged oneliners are returned. Without any ARGUMENTS, simply returns all flagged oneliners.")
+ :description "Request that only flagged oneliners are returned. Without any TERMS, simply returns all flagged oneliners.")
(flag :long-name "not-flagged"
- :description "Request that no flagged oneliners are returned with the search results. Does nothing without ARGUMENTS")
+ :description "Request that no flagged oneliners are returned with the search results. Does nothing without TERMS")
(flag :long-name "newest"
- :description "Return newest oneliners that match. Without any ARGUMENTS, simply returns the newest oneliners."))
- (text :contents " ")
- (group (:header "EXECUTION OPTIONS")
- (text :contents "Several options override the default interpretation of ARGUMENTS.")
- (text :contents "Execution options interpret the first argument as the identifier of a oneliner: ")
- (text :contents "$ ol <EXECUTION OPTION> <NAME or ID> [MORE ARGUMENTS...]")
+ :description "Return newest oneliners that match. Without any TERMS, simply returns the newest oneliners."))
+ (group (:header "RUNNING ONELINERS" :hidden t)
(text :contents " ")
- (flag :long-name "run"
- :description "Executes a oneliner by NAME or ID. See also help topic 'variables'.")
- (flag :long-name "clip"
- :description "Like --run, but puts the oneliner into the clipboard."))
- (text :contents " ")
- (group (:header "OTHER OPTIONS")
- (flag :long-name "show"
- :description "View all information for the oneliner given by NAME or ID")
+ (text :contents "Usage: ol [OPTIONS] run <IDENTIFIER> [ARGS...]")
+ (text :contents "Run the oneliner identified by IDENTIFIER, if it exists, with optionally supplied ARGS")
+ (text :contents "IDENTIFIER should either be the name or the unique numeric ID of a oneliner.")
+ (text :contents "E.g. `ol run demo foo bar` # run \"demo\" with args \"foo\" and \"bar\"")
+ (text :contents " ")
+ (text :contents "Options include:")
(lispobj :long-name "timeout"
+ :short-name "t"
:argument-type :optional
:argument-name "SECONDS"
- :default-value 2
+ :default-value 1
:typespec 'integer
- :description "How long to wait for standard output before giving up."))
- (text :contents " ")
- (group (:header "HELP OPTIONS")
- (flag :long-name "whois"
- :description "View information about a contributor. The first argument is a contributor handle.")
- (flag :long-name "help"
- :description "Print help for a topic. Topics: wiki, account, invites, variables, editor")
- (flag :long-name "version"
- :description "Print the client's version"))
- (group (:header "Advanced Options" :hidden t)
- (flag :long-name "clear-cache"
- :description "Clears all cached search results from your system."))
- (group (:header "Editor" :hidden t)
- (text :contents +configure-your-edtior+))
- (group (:header "Variables" :hidden t)
- (text :contents +oneliners-variables-help-text+))
- (group (:header "Wiki" :hidden t)
- (text :contents "Options For Managing Oneliners")
- (flag :long-name "add"
- :description "Intaractively add a oneliner and update the wiki.")
- (flag :long-name "edit"
- :description "Interactively edit a oneliner and update the wiki.")
- (flag :long-name "flag"
- :description "Flag a oneliner for review.")
- (flag :long-name "unflag"
- :description "If you have admin priviliges, unflag a oneliner.")
- (flag :long-name "lock"
- :description "If you have admin priviliges, lock a oneliner from being edited.")
- (flag :long-name "unlock"
- :description "If you have admin priviliges, unlock a oneliner."))
- (group (:header "Account" :hidden t)
- (text :contents "Options for Managing Your Contributor Account")
- (flag :long-name "login"
- :description "Attempt to login to your contributor account. ARGS are interpreted as USERNAME PASSWORD.")
- (flag :long-name "logout"
- :description "Revoke your own access token.")
- (flag :long-name "change-password"
- :description "Change your password. ARGS are interpreted as CURRENTPW NEWPW NEWPWAGAIN")
- (flag :long-name "change-signature"
- :description "Change your contributor signature. You will be prompted."))
- (group (:header "Invites" :hidden t)
+ :description "How many seconds to wait for standard output before giving up."))
+ (group (:header "CLIPPING ONELINERS" :hidden t)
+ (text :contents " ")
+ (text :contents "Usage: ol clip <IDENTIFIER> [ARGS...]")
+ (text :contents "Instead of running a oneliner, copy it to your system's clipboard")
+ (text :contents "ol clip demo-1 foo extra=bar"))
+ (group (:header "SHOWING INFORMATION ABOUT ONELINERS" :hidden t)
+ (text :contents " ")
+ (text :contents "Usage: ol show <IDENTIFIER>")
+ (text :contents "Print information about a oneliner to the screen."))
+ (group (:header "NEW ONELINERS" :hidden t)
+ (text :contents " ")
+ (text :contents "Usage: ol new")
+ (text :contents "Interactively create a new oneliner and upload it to the server."))
+ (group (:header "EDITING ONELINERS" :hidden t)
+ (text :contents " ")
+ (text :contents "Usage: ol edit <IDENTIFIER>")
+ (text :contents "Interactively alter a oneliner and uplaod it to the server."))
+ (group (:header "FLAGGING AND UNFLAGGING ONELINERS" :hidden t)
+ (text :contents " ")
+ (text :contents "Usage: ol <flag | unflag> <IDENTIFIER>")
+ (text :contents
+ "Flag or unflag a oneliner. A flagged oneliner is marked as potentially hazardous and will prompt users before exectuion.")
+ (text :contents
+ "Flagged oneliners may also be specifically factor into search using the --all-flagged or --not-flagged search options."))
+ (group (:header "LOCKING AND UNLOCKING ONELINERS" :hidden t)
+ (text :contents " ")
+ (text :contents "Usage: ol <lock | unlock> <IDENTIFIER>")
+ (text :contents "(ADMINS ONLY) Lock or unlock a oneliner. A locked oneliner may not be altered or edited."))
+ (group (:header "REDEEMING INVITE TOKENS" :hidden t)
+ (text :contents " ")
+ (text :contents "Usage: ol redeem <INVITE> <HANDLE> <PASSWORD>")
+ (text :contents "Redeem an invite token, INVITE, and reate a new contributor account on the wiki server with user handle and password."))
+ (group (:header "INVITE TOKENS" :hidden t)
+ (text :contents " ")
+ (text :contents "Usage: ol invite")
+ (text :contents "Generate a new invite token if you are allowed to do so."))
+ (group (:header "LOGIN AND LOGOUT" :hidden t)
+ (text :contents " ")
+ (text :contents "Usage: ol <login | logout> [HANDLE PASWORD]")
+ (text :contents "Login or logout. If logging in, provide a handle and password.")
+ (text :contents "Once logged in to your configured server, an API access token will be written to your config file, allowing you to make contributions to the wiki."))
+ (group (:header "PASSWORD CHANGES" :hidden t)
+ (text :contents " ")
+ (text :contents "Usage: ol password <OLD> <NEW> <REPEATED>")
+ (text :contents "Change your password on the configured server."))
+ (group (:header "SIGNATURE CHANGES" :hidden t)
+ (text :contents " ")
+ (text :contents "Usage: ol signature")
+ (text :contents "Interactively update your contributor signature."))
+ (group (:header "HELP MENU")
(text :contents " ")
- (text :contents "Options For Making Invites and Redeeming Tokens")
- (flag :long-name "invite"
- :description "Request an invite token to send to a friend.")
- (flag :long-name "redeem"
- :description "Redeem an invite token.")
- (text :contents +invite-help-text+)))
+ (text :contents "Usage: ol help [TOPIC]")
+ (text :contents "Print a help menu. With no arguments, prints this help.")
+ (text :contents "Help topics include: search, run, clip, show, new, edit, flag, lock, redeem, invite, login, password, signature")))
;;; HELPERS
@@ -179,7 +183,8 @@ you to go to sleep with it at night is written for the author more
than the users."
(loop for item in (net.didierverna.clon::items *synopsis*)
when (and (typep item 'net.didierverna.clon::group)
- (string-equal header (net.didierverna.clon::header item)))
+ (string-equal header (net.didierverna.clon::header item)
+ :end2 (length header)))
return item))
(defun prepare-oneliner-arguments (arguments)