From b75b4efe7eae930068641ccb6079f5bbb2e95668 Mon Sep 17 00:00:00 2001 From: "Kenneth M. Elf Sternberg" Date: Tue, 27 Sep 2016 10:06:01 -0700 Subject: [PATCH] Trying to get the man page just right. --- docs/git-lint.tex | 18 +----------------- utils/optstotex.hy | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 17 deletions(-) create mode 100644 utils/optstotex.hy diff --git a/docs/git-lint.tex b/docs/git-lint.tex index 5181ffb..9968cd2 100755 --- a/docs/git-lint.tex +++ b/docs/git-lint.tex @@ -33,23 +33,7 @@ \section{Synopsis} %%%%%%%%%%%%%%%%%% -\Prog{git-lint} - \oOptArg{-o}{ linters} - \oOptArg{-x}{ linters} - \oOpt{-l} - \oOpt{-b} - \oOpt{-a} - \oOpt{-e} - \oOpt{-w} - \oOpt{-s} - \oOpt{-g} - \oOpt{-p} - \oOpt{-t} - \oOpt{-f} - \oOpt{-d} - \oOptArg{-c}{ config-file} - \oOpt{-h} - \oOpt{-v} +\Prog{git lint} [..] [filenames..] \section{Description} %%%%%%%%%%%%%%%%%%%%% diff --git a/utils/optstotex.hy b/utils/optstotex.hy new file mode 100644 index 0000000..39e4c44 --- /dev/null +++ b/utils/optstotex.hy @@ -0,0 +1,20 @@ +#!/usr/bin/hy ; -*- mode: clojure -*- +(import subprocess os sys os.path) + +(defn fmit [formatstring iterable] + (apply .format (+ [formatstring] (list iterable)))) + +(defmain [&rest args] + (let [[git_dir (subprocess.check_output ["git" "rev-parse" "--show-toplevel"])]] + (.append sys.path (os.path.join git_dir "git_lint")) + (import [git_lint [git_lint]]) + (print (.join "\n" (map (fn [i] (if (get i 2) + (+ (fmit "\item[\oOptArg{{-{0}}}{{ names}} " i) + (fmit "\oOptArg{{--{1}}}={{ names}}] " i) + (fmit "{3}" i)) + (+ (fmit "\item[\oOptArg{{-{0}}} " i) + (fmit "\oOptArg{{--{1}}}] " i) + (fmit "{3}" i)))) + git_lint.OPTIONS_LIST))))) + +