-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into unbounded-splats
- Loading branch information
Showing
30 changed files
with
391 additions
and
155 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Busted | ||
|
||
on: [ push, pull_request ] | ||
|
||
jobs: | ||
|
||
busted: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
luaVersion: [ "5.4", "5.3", "5.2", "5.1", "luajit" ] # , "luajit-openresty" | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup ‘lua’ | ||
uses: leafo/gh-actions-lua@v10 | ||
with: | ||
luaVersion: ${{ matrix.luaVersion }} | ||
|
||
- name: Setup ‘luarocks’ | ||
uses: leafo/gh-actions-luarocks@v4 | ||
|
||
- name: Setup test dependencies | ||
run: | | ||
luarocks install --deps-only lua_cliargs-dev-1.rockspec | ||
luarocks install busted | ||
luarocks install dkjson | ||
luarocks install inifile | ||
${{ matrix.luaVersion != '5.4' && 'luarocks install yaml' || '' }} # https://github.com/lubyk/yaml/issues/7 | ||
- name: Replace system cliargs with self | ||
run: | | ||
luarocks remove --force lua_cliargs | ||
luarocks make | ||
- name: Run regression tests | ||
# disable project-local path prefixes to force use of system installation | ||
run: busted -v --lpath="" --cpath="" -Xoutput --color |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Deploy | ||
|
||
on: [ push, workflow_dispatch ] | ||
|
||
jobs: | ||
|
||
affected: | ||
uses: lunarmodules/.github/.github/workflows/list_affected_rockspecs.yml@main | ||
|
||
build: | ||
needs: affected | ||
if: ${{ needs.affected.outputs.rockspecs }} | ||
uses: lunarmodules/.github/.github/workflows/test_build_rock.yml@main | ||
with: | ||
rockspecs: ${{ needs.affected.outputs.rockspecs }} | ||
|
||
upload: | ||
needs: [ affected, build ] | ||
# Only run upload if: | ||
# 1. We are on the canonical repository (no uploads from forks) | ||
# 2. The current commit is either tagged or on the default branch (the workflow will upload dev/scm rockspecs any | ||
# time they are touched, tagged ones whenever the edited rockspec and tag match) | ||
# 3. Some rockspecs were changed — this implies the commit changing the rockspec is the same one that gets tagged | ||
if: >- | ||
${{ | ||
github.repository == 'lunarmodules/lua_cliargs' && | ||
( github.ref_name == 'master' || startsWith(github.ref, 'refs/tags/') ) && | ||
needs.affected.outputs.rockspecs | ||
}} | ||
uses: lunarmodules/.github/.github/workflows/upload_to_luarocks.yml@main | ||
with: | ||
rockspecs: ${{ needs.affected.outputs.rockspecs }} | ||
secrets: | ||
apikey: ${{ secrets.LUAROCKS_APIKEY }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: Luacheck | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
|
||
luacheck: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Luacheck | ||
uses: lunarmodules/luacheck@v1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,6 @@ cache = false | |
files["spec"] = { | ||
std = "+busted" | ||
} | ||
|
||
ignore = { "211/_" } | ||
exclude_files = { "examples" } |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,4 +13,4 @@ if [ ! -d src ]; then | |
exit 1 | ||
fi | ||
|
||
luacheck . | ||
luacheck --codes . $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
local package_name = "lua_cliargs" | ||
local package_version = "dev" | ||
local rockspec_revision = "1" | ||
local github_account_name = "lunarmodules" | ||
local github_repo_name = package_name | ||
|
||
rockspec_format = "3.0" | ||
package = package_name | ||
version = package_version .. "-" .. rockspec_revision | ||
|
||
source = { | ||
url = "git+https://github.com/" .. github_account_name .. "/" .. github_repo_name .. ".git" | ||
} | ||
if package_version == "dev" then source.branch = "master" else source.tag = "v" .. package_version end | ||
|
||
description = { | ||
summary = "A command-line argument parsing module for Lua", | ||
detailed = [[ | ||
This module adds support for accepting CLI arguments easily using multiple | ||
notations and argument types. | ||
cliargs allows you to define required, optional, and flag arguments. | ||
]], | ||
homepage = "https://github.com/"..github_account_name.."/"..github_repo_name, | ||
issues_url = "https://github.com/"..github_account_name.."/"..github_repo_name.."/issues", | ||
license = "MIT" | ||
} | ||
|
||
dependencies = { | ||
"lua >= 5.1" | ||
} | ||
|
||
test_dependencies = { | ||
"busted", | ||
"dkjson", | ||
"inifile", | ||
"yaml", | ||
} | ||
|
||
test = { | ||
type = "busted", | ||
} | ||
|
||
build = { | ||
type = "builtin", | ||
modules = { | ||
["cliargs"] = "src/cliargs.lua", | ||
["cliargs.config_loader"] = "src/cliargs/config_loader.lua", | ||
["cliargs.constants"] = "src/cliargs/constants.lua", | ||
["cliargs.core"] = "src/cliargs/core.lua", | ||
["cliargs.parser"] = "src/cliargs/parser.lua", | ||
["cliargs.printer"] = "src/cliargs/printer.lua", | ||
["cliargs.utils.disect"] = "src/cliargs/utils/disect.lua", | ||
["cliargs.utils.disect_argument"] = "src/cliargs/utils/disect_argument.lua", | ||
["cliargs.utils.filter"] = "src/cliargs/utils/filter.lua", | ||
["cliargs.utils.lookup"] = "src/cliargs/utils/lookup.lua", | ||
["cliargs.utils.shallow_copy"] = "src/cliargs/utils/shallow_copy.lua", | ||
["cliargs.utils.split"] = "src/cliargs/utils/split.lua", | ||
["cliargs.utils.trim"] = "src/cliargs/utils/trim.lua", | ||
["cliargs.utils.wordwrap"] = "src/cliargs/utils/wordwrap.lua", | ||
} | ||
} |
6 changes: 3 additions & 3 deletions
6
lua_cliargs-3.0-1.rockspec → rockspecs/lua_cliargs-3.0-2.rockspec
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
local package_name = "lua_cliargs" | ||
local package_version = "3.0.2" | ||
local rockspec_revision = "1" | ||
local github_account_name = "lunarmodules" | ||
local github_repo_name = package_name | ||
|
||
package = package_name | ||
version = package_version .. "-" .. rockspec_revision | ||
|
||
source = { | ||
url = "git+https://github.com/" .. github_account_name .. "/" .. github_repo_name .. ".git" | ||
} | ||
if package_version == "dev" then source.branch = "master" else source.tag = "v" .. package_version end | ||
|
||
description = { | ||
summary = "A command-line argument parsing module for Lua", | ||
detailed = [[ | ||
This module adds support for accepting CLI arguments easily using multiple | ||
notations and argument types. | ||
cliargs allows you to define required, optional, and flag arguments. | ||
]], | ||
license = "MIT" | ||
} | ||
|
||
dependencies = { | ||
"lua >= 5.1" | ||
} | ||
|
||
build = { | ||
type = "builtin", | ||
modules = { | ||
["cliargs"] = "src/cliargs.lua", | ||
["cliargs.config_loader"] = "src/cliargs/config_loader.lua", | ||
["cliargs.constants"] = "src/cliargs/constants.lua", | ||
["cliargs.core"] = "src/cliargs/core.lua", | ||
["cliargs.parser"] = "src/cliargs/parser.lua", | ||
["cliargs.printer"] = "src/cliargs/printer.lua", | ||
["cliargs.utils.disect"] = "src/cliargs/utils/disect.lua", | ||
["cliargs.utils.disect_argument"] = "src/cliargs/utils/disect_argument.lua", | ||
["cliargs.utils.filter"] = "src/cliargs/utils/filter.lua", | ||
["cliargs.utils.lookup"] = "src/cliargs/utils/lookup.lua", | ||
["cliargs.utils.shallow_copy"] = "src/cliargs/utils/shallow_copy.lua", | ||
["cliargs.utils.split"] = "src/cliargs/utils/split.lua", | ||
["cliargs.utils.trim"] = "src/cliargs/utils/trim.lua", | ||
["cliargs.utils.wordwrap"] = "src/cliargs/utils/wordwrap.lua", | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.