Skip to content

Commit 2da9ecd

Browse files
committed
Merge branch 'master' into unbounded-splats
2 parents 9afba52 + 684a028 commit 2da9ecd

30 files changed

+391
-155
lines changed

.env

Lines changed: 0 additions & 4 deletions
This file was deleted.

.github/workflows/busted.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Busted
2+
3+
on: [ push, pull_request ]
4+
5+
jobs:
6+
7+
busted:
8+
strategy:
9+
fail-fast: false
10+
matrix:
11+
luaVersion: [ "5.4", "5.3", "5.2", "5.1", "luajit" ] # , "luajit-openresty"
12+
runs-on: ubuntu-22.04
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
17+
- name: Setup ‘lua’
18+
uses: leafo/gh-actions-lua@v10
19+
with:
20+
luaVersion: ${{ matrix.luaVersion }}
21+
22+
- name: Setup ‘luarocks’
23+
uses: leafo/gh-actions-luarocks@v4
24+
25+
- name: Setup test dependencies
26+
run: |
27+
luarocks install --deps-only lua_cliargs-dev-1.rockspec
28+
luarocks install busted
29+
luarocks install dkjson
30+
luarocks install inifile
31+
${{ matrix.luaVersion != '5.4' && 'luarocks install yaml' || '' }} # https://github.com/lubyk/yaml/issues/7
32+
33+
- name: Replace system cliargs with self
34+
run: |
35+
luarocks remove --force lua_cliargs
36+
luarocks make
37+
38+
- name: Run regression tests
39+
# disable project-local path prefixes to force use of system installation
40+
run: busted -v --lpath="" --cpath="" -Xoutput --color

.github/workflows/deploy.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Deploy
2+
3+
on: [ push, workflow_dispatch ]
4+
5+
jobs:
6+
7+
affected:
8+
uses: lunarmodules/.github/.github/workflows/list_affected_rockspecs.yml@main
9+
10+
build:
11+
needs: affected
12+
if: ${{ needs.affected.outputs.rockspecs }}
13+
uses: lunarmodules/.github/.github/workflows/test_build_rock.yml@main
14+
with:
15+
rockspecs: ${{ needs.affected.outputs.rockspecs }}
16+
17+
upload:
18+
needs: [ affected, build ]
19+
# Only run upload if:
20+
# 1. We are on the canonical repository (no uploads from forks)
21+
# 2. The current commit is either tagged or on the default branch (the workflow will upload dev/scm rockspecs any
22+
# time they are touched, tagged ones whenever the edited rockspec and tag match)
23+
# 3. Some rockspecs were changed — this implies the commit changing the rockspec is the same one that gets tagged
24+
if: >-
25+
${{
26+
github.repository == 'lunarmodules/lua_cliargs' &&
27+
( github.ref_name == 'master' || startsWith(github.ref, 'refs/tags/') ) &&
28+
needs.affected.outputs.rockspecs
29+
}}
30+
uses: lunarmodules/.github/.github/workflows/upload_to_luarocks.yml@main
31+
with:
32+
rockspecs: ${{ needs.affected.outputs.rockspecs }}
33+
secrets:
34+
apikey: ${{ secrets.LUAROCKS_APIKEY }}

.github/workflows/luacheck.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Luacheck
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
7+
luacheck:
8+
runs-on: ubuntu-22.04
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v4
12+
- name: Luacheck
13+
uses: lunarmodules/luacheck@v1

.luacheckrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@ cache = false
44
files["spec"] = {
55
std = "+busted"
66
}
7+
8+
ignore = { "211/_" }
9+
exclude_files = { "examples" }

.travis.yml

Lines changed: 0 additions & 32 deletions
This file was deleted.

.travis_setup.sh

Lines changed: 0 additions & 46 deletions
This file was deleted.

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# lua_cliargs
22

3-
[![travis-ci status](https://secure.travis-ci.org/amireh/lua_cliargs.png)](http://travis-ci.org/#!/amireh/lua_cliargs/builds)
3+
[![Luacheck](https://img.shields.io/github/actions/workflow/status/lunarmodules/lua_cliargs/luacheck.yml?branch=master&label=Luacheck&logo=Lua)](https://github.com/lunarmodules/lua_cliargs/actions?workflow=Luacheck)
4+
[![Busted](https://img.shields.io/github/actions/workflow/status/lunarmodules/lua_cliargs/busted.yml?branch=master&label=Busted&logo=Lua)](https://github.com/lunarmodules/lua_cliargs/actions?workflow=Busted)
45

56
cliargs is a command-line argument parser for Lua. It supports several types of arguments:
67

@@ -134,6 +135,11 @@ cli:splat('MY_SPLAT', 'Description', nil, 1)
134135
Also, the library internally had an arbitrary limit of 999 repetitions for the
135136
splat argument. That limit has been relieved.
136137

138+
### 3.0-2
139+
140+
- optimized an internal routine responsible for word-wrapping. Thanks to
141+
@Tieske, refs GH-47
142+
137143
### Changes from 2.5.x 3.0
138144

139145
This major version release contains BREAKING API CHANGES. See the UPGRADE guide for help in updating your code to make use of it.

bin/lint

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ if [ ! -d src ]; then
1313
exit 1
1414
fi
1515

16-
luacheck .
16+
luacheck --codes . $@

lua_cliargs-dev-1.rockspec

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
local package_name = "lua_cliargs"
2+
local package_version = "dev"
3+
local rockspec_revision = "1"
4+
local github_account_name = "lunarmodules"
5+
local github_repo_name = package_name
6+
7+
rockspec_format = "3.0"
8+
package = package_name
9+
version = package_version .. "-" .. rockspec_revision
10+
11+
source = {
12+
url = "git+https://github.com/" .. github_account_name .. "/" .. github_repo_name .. ".git"
13+
}
14+
if package_version == "dev" then source.branch = "master" else source.tag = "v" .. package_version end
15+
16+
description = {
17+
summary = "A command-line argument parsing module for Lua",
18+
detailed = [[
19+
This module adds support for accepting CLI arguments easily using multiple
20+
notations and argument types.
21+
22+
cliargs allows you to define required, optional, and flag arguments.
23+
]],
24+
homepage = "https://github.com/"..github_account_name.."/"..github_repo_name,
25+
issues_url = "https://github.com/"..github_account_name.."/"..github_repo_name.."/issues",
26+
license = "MIT"
27+
}
28+
29+
dependencies = {
30+
"lua >= 5.1"
31+
}
32+
33+
test_dependencies = {
34+
"busted",
35+
"dkjson",
36+
"inifile",
37+
"yaml",
38+
}
39+
40+
test = {
41+
type = "busted",
42+
}
43+
44+
build = {
45+
type = "builtin",
46+
modules = {
47+
["cliargs"] = "src/cliargs.lua",
48+
["cliargs.config_loader"] = "src/cliargs/config_loader.lua",
49+
["cliargs.constants"] = "src/cliargs/constants.lua",
50+
["cliargs.core"] = "src/cliargs/core.lua",
51+
["cliargs.parser"] = "src/cliargs/parser.lua",
52+
["cliargs.printer"] = "src/cliargs/printer.lua",
53+
["cliargs.utils.disect"] = "src/cliargs/utils/disect.lua",
54+
["cliargs.utils.disect_argument"] = "src/cliargs/utils/disect_argument.lua",
55+
["cliargs.utils.filter"] = "src/cliargs/utils/filter.lua",
56+
["cliargs.utils.lookup"] = "src/cliargs/utils/lookup.lua",
57+
["cliargs.utils.shallow_copy"] = "src/cliargs/utils/shallow_copy.lua",
58+
["cliargs.utils.split"] = "src/cliargs/utils/split.lua",
59+
["cliargs.utils.trim"] = "src/cliargs/utils/trim.lua",
60+
["cliargs.utils.wordwrap"] = "src/cliargs/utils/wordwrap.lua",
61+
}
62+
}

0 commit comments

Comments
 (0)