commit 0b8c8315cedc58202c17a29cfb42a92c62c0f6ab parent 19a589165b258cf91cb6140418a2a34e54a60f8f Author: Ed van Bruggen <edvb54@gmail.com> Date: Tue, 8 Aug 2017 17:21:38 -0700 Create man page synopsis from usage message Diffstat:
Makefile | | | 12 | +++++++++--- |
README.md | | | 6 | ------ |
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/Makefile b/Makefile @@ -59,9 +59,15 @@ uninstall: man: @echo -n updating man page $(EXE).1 ... - @cat README.md | \ - sed "1s/$(EXE)/$(EXE) 1 \"`date +%B\ %Y`\" \"$(EXE)\ $(VERSION)\"\n\n##NAME\n\n& /" | \ - md2roff - | sed "9s/]/]\ /g" | sed "9s/|/|\ /g" > $(EXE).1 + @(head -1 README.md | sed "s/$(EXE)/$(EXE) 1 \"`date +%B\ %Y`\" \"$(EXE)\ $(VERSION)\"\n\n##NAME\n\n&/"; \ + echo "\n##SYNOPSIS\n"; \ + ./$(EXE) -h 2>&1 | sed -E 's/(\<[_A-Z][_A-Z]+\>)/\*\1\*/g' | \ + sed -E 's/(-[a-Z]+\>)/\*\*\1\*\*/g' | \ + sed -E 's/(\<$(EXE)\>)/\*\*\1\*\*/g' | \ + sed 's/_/\\_/g' | sed 's/:/:\ /g'| cut -d' ' -f2-; \ + echo "\n##DESCRIPTION"; \ + tail +2 README.md;) | \ + md2roff - | sed "9s/]/]\ /g" | sed "9s/|/|\ /g" > $(EXE).1 @echo \ done .PHONY: all options clean install uninstall man diff --git a/README.md b/README.md @@ -1,11 +1,5 @@ # gs \- painless gist creator -## SYNOPSIS - -**gs** [**-pPhv**] [**-e** *ID* [**-D** *FILE*]] [**-d** *DESCRIPTION*] [**-f** *FILENAME*] [**-g** *GITHUB\_URL*] [**-u** *USER*[: *PASSWORD*] | **-U**] [*FILES* ...] - -## DESCRIPTION - Easy way to create GitHub Gists through the command line. ## OPTIONS