From 9bceb2fffa854b0bdad9485d95fb233bda87db62 Mon Sep 17 00:00:00 2001 From: g1n Date: Sat, 3 Jul 2021 09:07:14 +0000 Subject: [PATCH] First commit: add help and usage --- twtxt-c | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100755 twtxt-c diff --git a/twtxt-c b/twtxt-c new file mode 100755 index 0000000..2a627cf --- /dev/null +++ b/twtxt-c @@ -0,0 +1,39 @@ +#!/bin/sh + +PROGNAME=${0##*/} +VERSION="0.0.1" + +error_exit() { + printf "%s: %s\n" "$PROGNAME" "${1:-"Unknown Error"}" >&2 + exit 1 +} + +usage() { + printf "usage: %s [OPTIONS] COMMAND [ARGS]\n" "$PROGNAME" + printf "Simple client for twtxt\n" + printf "Options:\n + -c, --config PATH Specify a custom config file location. + -v, --verbose Enable verbose output for debugging purposes. + --version Show the version and exit. + -h, --help Show this message and exit. + +Commands: + config Get or set config item. + follow Add a new source to your followings. + following Return the list of sources you’re following. + quickstart Quickstart wizard for setting up twtxt. + timeline Retrieve your personal timeline. + tweet Append a new tweet to your twtxt file. + unfollow Remove an existing source from your... + view Show feed of given source. + registry Show registers\n" +} +case $1 in + -h | --help) + usage; exit ;; + -* | --*) + usage; error_exit "unknown option $1" ;; + *) + echo " Work in Progress " + ;; +esac