From b0cbb4e380617a84fd560637bd81a2ee59303dc2 Mon Sep 17 00:00:00 2001 From: nytpu Date: Thu, 18 Mar 2021 10:53:51 -0600 Subject: [PATCH] update flags to be more easily usable --- doc/comitium.1.scd | 16 ++++++++-------- flags.go | 10 ++++------ 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/doc/comitium.1.scd b/doc/comitium.1.scd index 3e138ac..5760302 100644 --- a/doc/comitium.1.scd +++ b/doc/comitium.1.scd @@ -56,9 +56,9 @@ command-specific flags that are not universally recognized. ## ADD FLAGS -*-t* _TYPE_, *--type* _TYPE_ - Select which type a subscription is. Can be *g* for a Gemini feed; *a* for - Atom, RSS, & JSON; or *c* to watch the page for changes. Defaults to *g*. +*-w*, *--watch* + Watch a page for changes instead of adding as a feed. Useful for gophermaps, + or gemini/http resources with no parseable feed. # ENVIRONMENT VARIABLES @@ -96,19 +96,19 @@ Within the data directory, the following files are used: # EXAMPLES -This will add a new Gemini feed subscripton: +This will add a new feed subscripton: ``` comitium add gemini://nytpu.com/gemlog/ ``` -This will add a new atom subscription: +This will add a new subscription over http: ``` -comitium add -t a gemini://nytpu.com/flightlog/atom.xml +comitium add -t a https://www.nytpu.com/files/atom.xml ``` This will add a new subscription to watch for changes: ``` -comitium add --type a gemini://nytpu.com/photos/by-date.gmi nytpu's photos +comitium add --watch gemini://nytpu.com/photos/by-date.gmi nytpu's photos ``` Note that when watching a page for changes, you should manually add a title, otherwise the URL will be used. @@ -127,7 +127,7 @@ For more information, see the README at or in your local copy of the repository. For a tutorial, see the docs at or in -your local repository. +*docs/* in your local repository. # AUTHOR diff --git a/flags.go b/flags.go index 7f28bed..297018c 100644 --- a/flags.go +++ b/flags.go @@ -39,11 +39,9 @@ var commands = map[string]*flag.FlagSet{ // set up various flags for each individual command var ( // add - addTypeFlag = commands["add"].StringP( - "type", "t", // long and shorthand flag - "g", // default - `Select which type a subscription is. Can be "g" for a -Gemini feed; "a" for Atom, RSS, & JSON; or "c" to watch -the page for changes.`, + addTypeFlag = commands["add"].BoolP( + "watch", "w", // long and shorthand flag + false, // default + `Watch a page instead of adding it as a feed.`, ) )