From ceed3da428ced202efa1d01bb160004a5469d906 Mon Sep 17 00:00:00 2001 From: Jordan Irwin Date: Thu, 10 Aug 2017 12:56:52 -0700 Subject: [PATCH 1/4] Small change to version string for better readability --- ldoc.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ldoc.lua b/ldoc.lua index 4cb9966..515a520 100644 --- a/ldoc.lua +++ b/ldoc.lua @@ -37,7 +37,7 @@ app.require_here() --- @usage local usage = [[ -ldoc, a documentation generator for Lua, vs ]]..version..[[ +ldoc, a documentation generator for Lua, v]]..version..[[ -d,--dir (default doc) output directory -o,--output (default 'index') output name From 7a94466936facae01d94c175d67c58968af87717 Mon Sep 17 00:00:00 2001 From: Jordan Irwin Date: Thu, 10 Aug 2017 13:18:58 -0700 Subject: [PATCH 2/4] Clean up 'usage' for clarity in terminal output --- ldoc.lua | 64 ++++++++++++++++++++++++++++++-------------------------- 1 file changed, 34 insertions(+), 30 deletions(-) diff --git a/ldoc.lua b/ldoc.lua index 515a520..2c85937 100644 --- a/ldoc.lua +++ b/ldoc.lua @@ -39,36 +39,40 @@ app.require_here() local usage = [[ ldoc, a documentation generator for Lua, v]]..version..[[ - -d,--dir (default doc) output directory - -o,--output (default 'index') output name - -v,--verbose verbose - -a,--all show local functions, etc, in docs - -q,--quiet suppress output - -m,--module module docs as text - -s,--style (default !) directory for style sheet (ldoc.css) - -l,--template (default !) directory for template (ldoc.ltp) - -p,--project (default ldoc) project name - -t,--title (default Reference) page title - -f,--format (default plain) formatting - can be markdown, discount or plain - -b,--package (default .) top-level package basename (needed for module(...)) - -x,--ext (default html) output file extension - -c,--config (default config.ld) configuration name - -u,--unqualified don't show package name in sidebar links - -i,--ignore ignore any 'no doc comment or no module' warnings - -X,--not_luadoc break LuaDoc compatibility. Descriptions may continue after tags. - -D,--define (default none) set a flag to be used in config.ld - -C,--colon use colon style - -N,--no_args_infer don't infer arguments from source - -B,--boilerplate ignore first comment in source files - -M,--merge allow module merging - -S,--simple no return or params, no summary - -O,--one one-column output layout - --date (default system) use this date in generated doc - --dump debug output dump - --filter (default none) filter output as Lua data (e.g pl.pretty.dump) - --tags (default none) show all references to given tags, comma-separated - --fatalwarnings non-zero exit status on any warning - --testing reproducible build; no date or version on output + Invocation: + ldoc [options] + + Options: + -d,--dir (default doc) output directory + -o,--output (default 'index') output name + -v,--verbose verbose + -a,--all show local functions, etc, in docs + -q,--quiet suppress output + -m,--module module docs as text + -s,--style (default !) directory for style sheet (ldoc.css) + -l,--template (default !) directory for template (ldoc.ltp) + -p,--project (default ldoc) project name + -t,--title (default Reference) page title + -f,--format (default plain) formatting - can be markdown, discount or plain + -b,--package (default .) top-level package basename (needed for module(...)) + -x,--ext (default html) output file extension + -c,--config (default config.ld) configuration name + -u,--unqualified don't show package name in sidebar links + -i,--ignore ignore any 'no doc comment or no module' warnings + -X,--not_luadoc break LuaDoc compatibility. Descriptions may continue after tags. + -D,--define (default none) set a flag to be used in config.ld + -C,--colon use colon style + -N,--no_args_infer don't infer arguments from source + -B,--boilerplate ignore first comment in source files + -M,--merge allow module merging + -S,--simple no return or params, no summary + -O,--one one-column output layout + --date (default system) use this date in generated doc + --dump debug output dump + --filter (default none) filter output as Lua data (e.g pl.pretty.dump) + --tags (default none) show all references to given tags, comma-separated + --fatalwarnings non-zero exit status on any warning + --testing reproducible build; no date or version on output (string) source file or directory containing source From 1ba516719030468874614909501ea683cb916e1a Mon Sep 17 00:00:00 2001 From: Jordan Irwin Date: Thu, 10 Aug 2017 14:01:57 -0700 Subject: [PATCH 3/4] Add command line option for displaying version information: - Creates version option ('-V' or '--version'). - Allows invoking 'ldoc --version' without 'file' parameter. --- ldoc.lua | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/ldoc.lua b/ldoc.lua index 2c85937..d2bab14 100644 --- a/ldoc.lua +++ b/ldoc.lua @@ -41,8 +41,10 @@ ldoc, a documentation generator for Lua, v]]..version..[[ Invocation: ldoc [options] + ldoc --version Options: + -V,--version show version information -d,--dir (default doc) output directory -o,--output (default 'index') output name -v,--verbose verbose @@ -74,7 +76,7 @@ ldoc, a documentation generator for Lua, v]]..version..[[ --fatalwarnings non-zero exit status on any warning --testing reproducible build; no date or version on output - (string) source file or directory containing source + (optional string) source file or directory containing source `ldoc .` reads options from an `config.ld` file in same directory; `ldoc -c path/to/myconfig.ld ` reads options from `path/to/myconfig.ld` @@ -92,6 +94,11 @@ local KindMap = tools.KindMap local Item,File,Module = doc.Item,doc.File,doc.Module local quit = utils.quit +if args.version then + print('LDoc v' .. version) + os.exit(0) +end + local ModuleMap = class(KindMap) doc.ModuleMap = ModuleMap @@ -349,6 +356,9 @@ else if err then quit("no "..quote(args.config).." found") end end -- with user-provided file + if args.file == nil then + lapp.error('missing required parameter: file') + end args.file = abspath(args.file) end From 8564002c3b187d9096a9c3d3ab1946f2291aa5dc Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Wed, 30 Sep 2020 00:33:38 +0300 Subject: [PATCH 4/4] Tweak usage option order and correct small error in PR contribution --- ldoc.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ldoc.lua b/ldoc.lua index d2bab14..67ed016 100644 --- a/ldoc.lua +++ b/ldoc.lua @@ -44,7 +44,6 @@ ldoc, a documentation generator for Lua, v]]..version..[[ ldoc --version Options: - -V,--version show version information -d,--dir (default doc) output directory -o,--output (default 'index') output name -v,--verbose verbose @@ -69,6 +68,7 @@ ldoc, a documentation generator for Lua, v]]..version..[[ -M,--merge allow module merging -S,--simple no return or params, no summary -O,--one one-column output layout + -V,--version show version information --date (default system) use this date in generated doc --dump debug output dump --filter (default none) filter output as Lua data (e.g pl.pretty.dump) @@ -76,7 +76,7 @@ ldoc, a documentation generator for Lua, v]]..version..[[ --fatalwarnings non-zero exit status on any warning --testing reproducible build; no date or version on output - (optional string) source file or directory containing source + (string) source file or directory containing source `ldoc .` reads options from an `config.ld` file in same directory; `ldoc -c path/to/myconfig.ld ` reads options from `path/to/myconfig.ld`