documentation for ansicat/netcache/opnk

This commit is contained in:
Ploum 2023-11-09 12:36:32 +01:00
parent 24fe364f51
commit 5bf84c91fa
3 changed files with 17 additions and 3 deletions

View File

@ -1374,7 +1374,13 @@ def render(input,path=None,format="auto",mime=None,url=None):
def main():
parser = argparse.ArgumentParser(description=__doc__)
descri = "ansicat is a terminal rendering tool that will render multiple formats (HTML, \
Gemtext, RSS, Gophermap, Image) into ANSI text and colors.\n\
When used on a file, ansicat will try to autodetect the format. When used with \
standad input, the format must be manually specified.\n\
If the content contains links, the original URL of the content can be specified \
in order to correctly modify relatives links."
parser = argparse.ArgumentParser(prog="ansicat",description=descri)
parser.add_argument("--format", choices=["auto","gemtext","html","feed","gopher","image","folder","text","plaintext"],
help="Renderer to use. Available: auto, gemtext, html, feed, gopher, image, folder, plaintext")
parser.add_argument("--mime", help="Mime of the content to parse")

View File

@ -862,8 +862,12 @@ def fetch(url,offline=False,download_image_first=True,images_mode="readable",val
def main():
descri="Netcache is a command-line tool to retrieve, cache and access networked content.\n\
By default, netcache will returns a cached version of a given URL, downloading it \
only if not existing. A validity duration, in seconds, can also be given so that \
netcache downloads the content only if the existing cache is older than the validity."
# Parse arguments
parser = argparse.ArgumentParser(description=__doc__)
parser = argparse.ArgumentParser(prog="netcache",description=descri)
parser.add_argument("--path", action="store_true",
help="return path to the cache instead of the content of the cache")
parser.add_argument("--offline", action="store_true",

View File

@ -274,7 +274,11 @@ class opencache():
self.last_mode = {}
def main():
parser = argparse.ArgumentParser(description=__doc__)
descri = "opnk is an universal open command tool that will try to display any file \
in the pager less after rendering its content with ansicat. If that fails, \
opnk will fallback to opening the file with xdg-open. If given an URL as input \
instead of a path, opnk will rely on netcache to get the networked content."
parser = argparse.ArgumentParser(prog="opnk",description=descri)
parser.add_argument("content",metavar="INPUT", nargs="*",
default=sys.stdin, help="Path to the file or URL to open")
args = parser.parse_args()