Skip to content

Commit 22ee99f

Browse files
committed
Merge branch 'master' inte deining/master
2 parents 5170ca3 + 5e77d9e commit 22ee99f

22 files changed

+230
-110
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

.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: 2 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

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

0 commit comments

Comments
 (0)