From 15547b7e9a178af50d8a9d96f27138e9462019ea Mon Sep 17 00:00:00 2001 From: "Gary V. Vaughan" Date: Sat, 3 Jun 2017 17:35:58 -0700 Subject: [PATCH] maint: bump relase version to 1.2. * Makefile (VERSION): Bump to 1.2, * optparse-1.1.1-1.rockspec: Rename from this... * optparse-1.2-1.rockspec: ...to this. (_MODREV, _SPECREV): New variables, (version, source.url, source.dir): Adjust accordingly. * lib/optparse/version.lua: Regenerate. * .gitignore: Allow luadoc output in releases. * doc/index.html, doc/ldoc.css: Regenerate. * NEWS.md: Update. Signed-off-by: Gary V. Vaughan --- .gitignore | 3 +- Makefile | 2 +- NEWS.md | 2 +- doc/index.html | 932 ++++++++++++++++++++++++++++++++++++++ doc/ldoc.css | 303 +++++++++++++ lib/optparse/version.lua | 2 +- optparse-1.1.1-1.rockspec | 29 -- optparse-1.2-1.rockspec | 31 ++ 8 files changed, 1270 insertions(+), 34 deletions(-) create mode 100644 doc/index.html create mode 100644 doc/ldoc.css delete mode 100644 optparse-1.1.1-1.rockspec create mode 100644 optparse-1.2-1.rockspec diff --git a/.gitignore b/.gitignore index 5268830..610d8d0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ .DS_Store -/doc/* -!/doc/config.ld.in +/doc/config.ld* /optparse-*.src.rock diff --git a/Makefile b/Makefile index b5eb79c..20cf5c6 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ MKDIR = mkdir -p SED = sed SPECL = specl -VERSION = 1.1.1 +VERSION = 1.2 luadir = lib/optparse SOURCES = \ diff --git a/NEWS.md b/NEWS.md index 72241f2..3e8f04c 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,6 @@ # optparse NEWS - User visible changes -## Noteworthy changes in release ?.?.? (????-??-??) [?] +## Noteworthy changes in release 1.2 (2017-06-03) [stable] ### Bug fixes diff --git a/doc/index.html b/doc/index.html new file mode 100644 index 0000000..2ca333d --- /dev/null +++ b/doc/index.html @@ -0,0 +1,932 @@ + + + + + optparse 1.2 Reference + + + + +
+ +
+ +
+
+
+ + +
+ + + + + + +
+ +

Module optparse

+

Parse and process command line options.

+

In the common case, you can write the long-form help output typical of + a modern-command line program, and let this module generate a custom + parser that collects and diagnoses the options it describes.

+ +

The parser is an object instance which can then be tweaked for + the uncommon case, by hand, or by using the on method to tie your + custom handlers to options that are not handled quite the way you'd + like.

+ + +

Objects

+ + + + + +
OptionParserOptionParser prototype object.
+

Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
optional (arglist, i[, value=true])Option at arglist[i] can take an argument.
required (arglist, i[, value])Option at arglist[i] requires an argument.
finished (arglist, i)Finish option processing

+ +

This is the handler automatically assigned to the option written as + -- in the OptionParser spec argument.

flag (arglist, i[, value])Option at arglist[i] is a boolean switch.
help ()Option should display help text, then exit.
version ()Option should display version text, then exit.
boolean (opt[, optarg="1"])Return a Lua boolean equivalent of various optarg strings.
file (opt, optarg)Report an option parse error unless optarg names an + existing file.
opterr (msg)Report an option parse error, then exit with status 2.
on_handler (arglist, i[, value=nil])Function signature of an option handler for on.
on (name, handler, value)Add an option handler.
parse (arglist[, defaults])Parse an argument list.
OptionParser_Init (spec)Signature for initialising a custom OptionParser.
+

Tables

+ + + + + + + + + + + + + +
boolvalsMap various option strings to equivalent Lua boolean values.
optsParsed options table, with a key for each encountered option, each + with value set by that option's on_handler.
optparseModule table.
+

Metamethods

+ + + + + +
__index (name)Lazy loading of optparse submodules.
+ +
+
+ + +

Objects

+ +
+
+ + OptionParser +
+
+ OptionParser prototype object.

+ +

Most often, after instantiating an OptionParser, everything else + is handled automatically.

+ +

Then, calling parser:parse as shown below saves unparsed arguments + into _G.arg (usually filenames or similar), and _G.opts will be a + table of successfully parsed option values. The keys into this table + are the long-options with leading hyphens stripped, and non-word + characters turned to _. For example if --another-long had been + found in the initial _G.arg, then _G.opts will have a key named + another_long, with an appropriate value. If there is no long + option name, then the short option is used, i.e. _G.opts.b will be + set.

+ +

The values saved against those keys are controlled by the option + handler, usually just true or the option argument string as + appropriate. + + +

Fields:

+
    +
  • _init + OptionParser_Init + initialisation function +
  • +
  • program + string + the first word following "Usage:" from spec +
  • +
  • version + string + the last white-space delimited word on the first line + of text from spec +
  • +
  • versiontext + string + everything preceding "Usage:" from spec, and + which will be displayed by the version on_handler +
  • +
  • helptext + string + everything including and following "Usage:" from + spec string and which will be displayed by the help + on_handler +
  • +
+ + + + +

Usage:

+
    +
    local optparse = require "optparse"
    +
    +local optparser = optparse [[
    +any text VERSION
    +Additional lines of text to show when the --version
    +option is passed.
    +
    +Several lines or paragraphs are permitted.
    +
    +Usage: PROGNAME
    +
    +Banner text.
    +
    +Optional long description text to show when the --help
    +option is passed.
    +
    +Several lines or paragraphs of long description are permitted.
    +
    +Options:
    +
    +  -b                       a short option with no long option
    +      --long               a long option with no short option
    +      --another-long       a long option with internal hypen
    +      --really-long-option-name
    +                           with description on following line
    +  -v, --verbose            a combined short and long option
    +  -n, --dryrun, --dry-run  several spellings of the same option
    +  -u, --name=USER          require an argument
    +  -o, --output=[FILE]      accept an optional argument
    +      --version            display version information, then exit
    +      --help               display this help, then exit
    +
    +Footer text.  Several lines or paragraphs are permitted.
    +
    +Please report bugs at bug-list@yourhost.com
    +]]
    +
    +-- Note that `std.io.die` and `std.io.warn` will only prefix messages
    +-- with `parser.program` if the parser options are assigned back to
    +-- `_G.opts`:
    +_G.arg, _G.opts = optparser:parse (_G.arg)
    +
+ +
+
+

Functions

+ +
+
+ + optional (arglist, i[, value=true]) +
+
+ Option at arglist[i] can take an argument. + Argument is accepted only if there is a following entry that does not + begin with a '-'.

+ +

This is the handler automatically assigned to options that have + --opt=[ARG] style specifications in the OptionParser spec + argument. You can also pass it as the handler argument to on for + options you want to add manually without putting them in the + OptionParser spec.

+ +

Like required, this handler will store multiple occurrences of a + command-line option. + + +

Parameters:

+
    +
  • arglist + table + list of arguments +
  • +
  • i + int + index of last processed element of arglist +
  • +
  • value + either a function to process the option + argument, or a default value if encountered without an optarg + (default true) +
  • +
+ +

Returns:

+
    + + int + index of next element of arglist to process +
+ + + +

Usage:

+
    +
    parser:on ("--enable-nls", parser.option, parser.boolean)
    +
+ +
+
+ + required (arglist, i[, value]) +
+
+ +

Option at arglist[i] requires an argument.

+ +

This is the handler automatically assigned to options that have + --opt=ARG style specifications in the OptionParser spec argument. + You can also pass it as the handler argument to on for options + you want to add manually without putting them in the OptionParser + spec.

+ +

Normally the value stored in the opt table by this handler will be + the string given as the argument to that option on the command line. + However, if the option is given on the command-line multiple times, + opt["name"] will end up with all those arguments stored in the + array part of a table:

+ +
 $ cat ./prog
+ ...
+ parser:on ({"-e", "-exec"}, required)
+ _G.arg, _G.opt = parser:parse (_G.arg)
+ print (tostring (_G.opt.exec))
+ ...
+ $ ./prog -e '(foo bar)' -e '(foo baz)' -- qux
+ {1=(foo bar),2=(foo baz)}
+
+ + + +

Parameters:

+
    +
  • arglist + table + list of arguments +
  • +
  • i + int + index of last processed element of arglist +
  • +
  • value + either a function to process the option argument, + or a forced value to replace the user's option argument. + (optional) +
  • +
+ +

Returns:

+
    + + int + index of next element of arglist to process +
+ + + +

Usage:

+
    +
    parser:on ({"-o", "--output"}, parser.required)
    +
+ +
+
+ + finished (arglist, i) +
+
+ Finish option processing

+ +

This is the handler automatically assigned to the option written as + -- in the OptionParser spec argument. You can also pass it as + the handler argument to on if you want to manually add an end + of options marker without writing it in the OptionParser spec.

+ +

This handler tells the parser to stop processing arguments, so that + anything after it will be an argument even if it otherwise looks + like an option. + + +

Parameters:

+
    +
  • arglist + table + list of arguments +
  • +
  • i + int + index of last processed element of arglist +
  • +
+ +

Returns:

+
    + + int + index of next element of arglist to process +
+ + + +

Usage:

+
    +
    parser:on ("--", parser.finished)
    +
+ +
+
+ + flag (arglist, i[, value]) +
+
+ Option at arglist[i] is a boolean switch.

+ +

This is the handler automatically assigned to options that have + --long-opt or -x style specifications in the OptionParser spec + argument. You can also pass it as the handler argument to on for + options you want to add manually without putting them in the + OptionParser spec.

+ +

Beware that, unlike required, this handler will store multiple + occurrences of a command-line option as a table only when given a + value function. Automatically assigned handlers do not do this, so + the option will simply be true if the option was given one or more + times on the command-line. + + +

Parameters:

+
    +
  • arglist + table + list of arguments +
  • +
  • i + int + index of last processed element of arglist +
  • +
  • value + either a function to process the option argument, + or a value to store when this flag is encountered + (optional) +
  • +
+ +

Returns:

+
    + + int + index of next element of arglist to process +
+ + + +

Usage:

+
    +
    parser:on ({"--long-opt", "-x"}, parser.flag)
    +
+ +
+
+ + help () +
+
+ Option should display help text, then exit.

+ +

This is the handler automatically assigned tooptions that have + --help in the specification, e.g. -h, -?, --help. + + + + + + +

Usage:

+
    +
    parser:on ("-?", parser.version)
    +
+ +
+
+ + version () +
+
+ Option should display version text, then exit.

+ +

This is the handler automatically assigned tooptions that have + --version in the specification, e.g. -V, --version. + + + + + + +

Usage:

+
    +
    parser:on ("-V", parser.version)
    +
+ +
+
+ + boolean (opt[, optarg="1"]) +
+
+ Return a Lua boolean equivalent of various optarg strings. + Report an option parse error if optarg is not recognised.

+ +

Pass this as the value function to on when you want various + "truthy" or "falsey" option arguments to be coerced to a Lua true + or false respectively in the options table. + + +

Parameters:

+
    +
  • opt + string + option name +
  • +
  • optarg + string + option argument, must be a key in boolvals + (default "1") +
  • +
+ +

Returns:

+
    + + bool + true or false +
+ + + +

Usage:

+
    +
    parser:on ("--enable-nls", parser.optional, parser.boolean)
    +
+ +
+
+ + file (opt, optarg) +
+
+ Report an option parse error unless optarg names an + existing file.

+ +

Pass this as the value function to on when you want to accept + only option arguments that name an existing file. + + +

Parameters:

+
    +
  • opt + string + option name +
  • +
  • optarg + string + option argument, must be an existing file +
  • +
+ +

Returns:

+
    + + string + optarg +
+ + + +

Usage:

+
    +
    parser:on ("--config-file", parser.required, parser.file)
    +
+ +
+
+ + opterr (msg) +
+
+ Report an option parse error, then exit with status 2.

+ +

Use this in your custom option handlers for consistency with the + error output from built-in optparse error messages. + + +

Parameters:

+
    +
  • msg + string + error message +
  • +
+ + + + + +
+
+ + on_handler (arglist, i[, value=nil]) +
+
+ Function signature of an option handler for on. + + +

Parameters:

+
    +
  • arglist + table + list of arguments +
  • +
  • i + int + index of last processed element of arglist +
  • +
  • value + additional value registered with on + (default nil) +
  • +
+ +

Returns:

+
    + + int + index of next element of arglist to process +
+ + + + +
+
+ + on (name, handler, value) +
+
+ Add an option handler.

+ +

When the automatically assigned option handlers don't do everything + you require, or when you don't want to put an option into the + OptionParser spec argument, use this function to specify custom + behaviour. If you write the option into the spec argument anyway, + calling this function will replace the automatically assigned handler + with your own.

+ +

When writing your own handlers for optparse:on, you only need + to deal with normalised arguments, because combined short arguments + (-xyz), equals separators to long options (--long=ARG) are fully + expanded before any handler is called. + + +

Parameters:

+
    +
  • name + opts + of the option, or list of option names +
  • +
  • handler + on_handler + function to call when any of opts is + encountered +
  • +
  • value + additional value passed to on_handler +
  • +
+ + + + +

Usage:

+
    +
    -- Don't process any arguments after `--`
    +parser:on ('--', parser.finished)
    +
+ +
+
+ + parse (arglist[, defaults]) +
+
+ Parse an argument list. + + +

Parameters:

+
    +
  • arglist + table + list of arguments +
  • +
  • defaults + table + table of default option values + (optional) +
  • +
+ +

Returns:

+
    +
  1. + table + a list of unrecognised arglist elements
  2. +
  3. + opts + parsing results
  4. +
+ + + + +
+
+ + OptionParser_Init (spec) +
+
+ Signature for initialising a custom OptionParser.

+ +

Read the documented options from spec and return custom parser that + can be used for parsing the options described in spec from a run-time + argument list. Options in spec are recognised as lines that begin + with at least two spaces, followed by a hyphen. + + +

Parameters:

+
    +
  • spec + string + option parsing specification +
  • +
+ +

Returns:

+
    + + OptionParser + a parser for options described by spec +
+ + + +

Usage:

+
    +
    customparser = optparse (optparse_spec)
    +
+ +
+
+

Tables

+ +
+
+ + boolvals +
+
+ Map various option strings to equivalent Lua boolean values. + + +

Fields:

+
    +
  • false + false +
  • +
  • 0 + false +
  • +
  • no + false +
  • +
  • n + false +
  • +
  • true + true +
  • +
  • 1 + true +
  • +
  • yes + true +
  • +
  • y + true +
  • +
+ + + + + +
+
+ + opts +
+
+ Parsed options table, with a key for each encountered option, each + with value set by that option's on_handler. Where an option + has one or more long-options specified, the key will be the first + one of those with leading hyphens stripped and non-alphanumeric + characters replaced with underscores. For options that can only be + specified by a short option, the key will be the letter of the first + of the specified short options:

+ +
 {"-e", "--eval-file"} => opts.eval_file
+ {"-n", "--dryrun", "--dry-run"} => opts.dryrun
+ {"-t", "-T"} => opts.t
+
+ +

Generally there will be one key for each previously specified + option (either automatically assigned by OptionParser or + added manually with on) containing the value(s) assigned by the + associated on_handler. For automatically assigned handlers, + that means true for straight-forward flags and + optional-argument options for which no argument was given; or else + the string value of the argument passed with an option given only + once; or a table of string values of the same for arguments given + multiple times.

+ +
 ./prog -x -n -x => opts = { x = true, dryrun = true }
+ ./prog -e '(foo bar)' -e '(foo baz)'
+     => opts = {eval_file = {"(foo bar)", "(foo baz)"} }
+
+ +

If you write your own handlers, or otherwise specify custom + handling of options with on, then whatever value those handlers + return will be assigned to the respective keys in opts. + + + + + + + +

+
+ + optparse +
+
+ Module table. + + +

Fields:

+
    +
  • version + string + release version identifier +
  • +
+ + + + + +
+
+

Metamethods

+ +
+
+ + __index (name) +
+
+ Lazy loading of optparse submodules. + Don't load everything on initial startup, wait until first attempt + to access a submodule, and then load it on demand. + + +

Parameters:

+
    +
  • name + string + submodule name +
  • +
+ +

Returns:

+
    + + table or nil + the submodule that was loaded to satisfy the missing + name, otherwise nil if nothing was found +
+ + + +

Usage:

+
    +
    local optparse = require "optparse"
    +local version = optparse.version
    +
+ +
+
+ + +
+
+
+generated by LDoc 1.4.6 +Last updated 2017-06-03 17:46:54 +
+
+ + diff --git a/doc/ldoc.css b/doc/ldoc.css new file mode 100644 index 0000000..52c4ad2 --- /dev/null +++ b/doc/ldoc.css @@ -0,0 +1,303 @@ +/* BEGIN RESET + +Copyright (c) 2010, Yahoo! Inc. All rights reserved. +Code licensed under the BSD License: +http://developer.yahoo.com/yui/license.html +version: 2.8.2r1 +*/ +html { + color: #000; + background: #FFF; +} +body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,button,textarea,p,blockquote,th,td { + margin: 0; + padding: 0; +} +table { + border-collapse: collapse; + border-spacing: 0; +} +fieldset,img { + border: 0; +} +address,caption,cite,code,dfn,em,strong,th,var,optgroup { + font-style: inherit; + font-weight: inherit; +} +del,ins { + text-decoration: none; +} +li { + margin-left: 20px; +} +caption,th { + text-align: left; +} +h1,h2,h3,h4,h5,h6 { + font-size: 100%; + font-weight: bold; +} +q:before,q:after { + content: ''; +} +abbr,acronym { + border: 0; + font-variant: normal; +} +sup { + vertical-align: baseline; +} +sub { + vertical-align: baseline; +} +legend { + color: #000; +} +input,button,textarea,select,optgroup,option { + font-family: inherit; + font-size: inherit; + font-style: inherit; + font-weight: inherit; +} +input,button,textarea,select {*font-size:100%; +} +/* END RESET */ + +body { + margin-left: 1em; + margin-right: 1em; + font-family: arial, helvetica, geneva, sans-serif; + background-color: #ffffff; margin: 0px; +} + +code, tt { font-family: monospace; font-size: 1.1em; } +span.parameter { font-family:monospace; } +span.parameter:after { content:":"; } +span.types:before { content:"("; } +span.types:after { content:")"; } +.type { font-weight: bold; font-style:italic } + +body, p, td, th { font-size: .95em; line-height: 1.2em;} + +p, ul { margin: 10px 0 0 0px;} + +strong { font-weight: bold;} + +em { font-style: italic;} + +h1 { + font-size: 1.5em; + margin: 20px 0 20px 0; +} +h2, h3, h4 { margin: 15px 0 10px 0; } +h2 { font-size: 1.25em; } +h3 { font-size: 1.15em; } +h4 { font-size: 1.06em; } + +a:link { font-weight: bold; color: #004080; text-decoration: none; } +a:visited { font-weight: bold; color: #006699; text-decoration: none; } +a:link:hover { text-decoration: underline; } + +hr { + color:#cccccc; + background: #00007f; + height: 1px; +} + +blockquote { margin-left: 3em; } + +ul { list-style-type: disc; } + +p.name { + font-family: "Andale Mono", monospace; + padding-top: 1em; +} + +pre { + background-color: rgb(245, 245, 245); + border: 1px solid #C0C0C0; /* silver */ + padding: 10px; + margin: 10px 0 10px 0; + overflow: auto; + font-family: "Andale Mono", monospace; +} + +pre.example { + font-size: .85em; +} + +table.index { border: 1px #00007f; } +table.index td { text-align: left; vertical-align: top; } + +#container { + margin-left: 1em; + margin-right: 1em; + background-color: #f0f0f0; +} + +#product { + text-align: center; + border-bottom: 1px solid #cccccc; + background-color: #ffffff; +} + +#product big { + font-size: 2em; +} + +#main { + background-color: #f0f0f0; + border-left: 2px solid #cccccc; +} + +#navigation { + float: left; + width: 14em; + vertical-align: top; + background-color: #f0f0f0; + overflow: visible; +} + +#navigation h2 { + background-color:#e7e7e7; + font-size:1.1em; + color:#000000; + text-align: left; + padding:0.2em; + border-top:1px solid #dddddd; + border-bottom:1px solid #dddddd; +} + +#navigation ul +{ + font-size:1em; + list-style-type: none; + margin: 1px 1px 10px 1px; +} + +#navigation li { + text-indent: -1em; + display: block; + margin: 3px 0px 0px 22px; +} + +#navigation li li a { + margin: 0px 3px 0px -1em; +} + +#content { + margin-left: 14em; + padding: 1em; + width: 700px; + border-left: 2px solid #cccccc; + border-right: 2px solid #cccccc; + background-color: #ffffff; +} + +#about { + clear: both; + padding: 5px; + border-top: 2px solid #cccccc; + background-color: #ffffff; +} + +@media print { + body { + font: 12pt "Times New Roman", "TimeNR", Times, serif; + } + a { font-weight: bold; color: #004080; text-decoration: underline; } + + #main { + background-color: #ffffff; + border-left: 0px; + } + + #container { + margin-left: 2%; + margin-right: 2%; + background-color: #ffffff; + } + + #content { + padding: 1em; + background-color: #ffffff; + } + + #navigation { + display: none; + } + pre.example { + font-family: "Andale Mono", monospace; + font-size: 10pt; + page-break-inside: avoid; + } +} + +table.module_list { + border-width: 1px; + border-style: solid; + border-color: #cccccc; + border-collapse: collapse; +} +table.module_list td { + border-width: 1px; + padding: 3px; + border-style: solid; + border-color: #cccccc; +} +table.module_list td.name { background-color: #f0f0f0; min-width: 200px; } +table.module_list td.summary { width: 100%; } + + +table.function_list { + border-width: 1px; + border-style: solid; + border-color: #cccccc; + border-collapse: collapse; +} +table.function_list td { + border-width: 1px; + padding: 3px; + border-style: solid; + border-color: #cccccc; +} +table.function_list td.name { background-color: #f0f0f0; min-width: 200px; } +table.function_list td.summary { width: 100%; } + +ul.nowrap { + overflow:auto; + white-space:nowrap; +} + +dl.table dt, dl.function dt {border-top: 1px solid #ccc; padding-top: 1em;} +dl.table dd, dl.function dd {padding-bottom: 1em; margin: 10px 0 0 20px;} +dl.table h3, dl.function h3 {font-size: .95em;} + +/* stop sublists from having initial vertical space */ +ul ul { margin-top: 0px; } +ol ul { margin-top: 0px; } +ol ol { margin-top: 0px; } +ul ol { margin-top: 0px; } + +/* make the target distinct; helps when we're navigating to a function */ +a:target + * { + background-color: #FF9; +} + + +/* styles for prettification of source */ +pre .comment { color: #558817; } +pre .constant { color: #a8660d; } +pre .escape { color: #844631; } +pre .keyword { color: #aa5050; font-weight: bold; } +pre .library { color: #0e7c6b; } +pre .marker { color: #512b1e; background: #fedc56; font-weight: bold; } +pre .string { color: #8080ff; } +pre .number { color: #f8660d; } +pre .operator { color: #2239a8; font-weight: bold; } +pre .preprocessor, pre .prepro { color: #a33243; } +pre .global { color: #800080; } +pre .user-keyword { color: #800080; } +pre .prompt { color: #558817; } +pre .url { color: #272fc2; text-decoration: underline; } + diff --git a/lib/optparse/version.lua b/lib/optparse/version.lua index 72260ba..779903a 100644 --- a/lib/optparse/version.lua +++ b/lib/optparse/version.lua @@ -1 +1 @@ -return "Parse Command-Line Options / 1.1.1" +return "Parse Command-Line Options / 1.2" diff --git a/optparse-1.1.1-1.rockspec b/optparse-1.1.1-1.rockspec deleted file mode 100644 index c5ac715..0000000 --- a/optparse-1.1.1-1.rockspec +++ /dev/null @@ -1,29 +0,0 @@ -package = "optparse" -version = "1.1.1-1" - -description = { - summary = "Parse and process command-line options", - detailed = [[ - Automatically generate a custom command-line option parser from - just the long-form help text for your program. - ]], - homepage = "http://gvvaughan.github.io/optparse", - license = "MIT/X11", -} - -source = { - url = "http://github.com/gvvaughan/optparse/archive/v1.1.1.zip", - dir = "optparse-1.1.1", -} - -dependencies = { - "lua >= 5.1, < 5.4", -} - -build = { - type = "builtin", - modules = { - optparse = "lib/optparse/init.lua", - ["optparse.version"] = "lib/optparse/version.lua", - }, -} diff --git a/optparse-1.2-1.rockspec b/optparse-1.2-1.rockspec new file mode 100644 index 0000000..ce38c45 --- /dev/null +++ b/optparse-1.2-1.rockspec @@ -0,0 +1,31 @@ +local _MODREV, _SPECREV = '1.2', '-1' + +package = 'optparse' +version = _MODREV .. _SPECREV + +description = { + summary = 'Parse and process command-line options', + detailed = [[ + Automatically generate a custom command-line option parser from + just the long-form help text for your program. + ]], + homepage = 'http://gvvaughan.github.io/optparse', + license = 'MIT/X11', +} + +source = { + url = 'http://github.com/gvvaughan/optparse/archive/v' .. _MODREV .. '.zip', + dir = 'optparse-' .. _MODREV, +} + +dependencies = { + 'lua >= 5.1, < 5.4', +} + +build = { + type = 'builtin', + modules = { + optparse = 'lib/optparse/init.lua', + ['optparse.version'] = 'lib/optparse/version.lua', + }, +}