Crash when reading numbers and/or boolean values from ini files
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 55/100
Research direction
Start by running the provided test.ini and test.lua example, then inspect cliargs/config_loader.lua around line 99 and cliargs/utils/trim.lua around line 3. Confirm that numeric and boolean INI values no longer crash while string values continue to work, including the read_defaults fourth-parameter cases described in the issue.
Written by the indexing model from the issue text.
Description
Even with #63 applied, reading from .ini files can fail:
Minimum working example:
test.ini
[database]
verbose=true
port=5432
test.lua
1 cli = require 'cliargs';
2 tbl = cli:read_defaults('test.ini', 'ini', 'database', false);
Running test.lua result in this error:
attempt to index a boolean value (local 'str')
stack traceback:
./cliargs/utils/trim.lua:3: in function 'cliargs.utils.trim'
./cliargs/config_loader.lua:99: in function 'cliargs.config_loader.from_ini'
(...tail calls...)
./test.lua:2: in main chunk
[C]: in ?
Notes:
- the error does not occur once I read only string values from the ini file
- the error disappear once I set the fourth parameter of function
read_defaultstotrue(line 2)
- Dominant language
- Lua
- Stars
- 129
- Forks
- 26
- Avg merge
- 1h 41m
- Merged PRs (30d)
- 1
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from lunarmodules/lua_cliargs
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
lunarmodules/lua_cliargs#85 · 1 comment ·
-
Parsing --help needs to return something other than an errorPossibly taken @TheMagician23 claimed this 1028 days ago. Open
Difficulty 4/5 3-5 days Newbie friendliness 35/100
lunarmodules/lua_cliargs#72 · 1 comment ·
-
Option to accept multiple options not documentedPossibly taken @copilot-swe-agent claimed this 65 days ago. Open
Difficulty 1/5 Under an hour Newbie friendliness 48/100
lunarmodules/lua_cliargs#70 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
lunarmodules/lua_cliargs#69 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
lunarmodules/lua_cliargs#68 ·
All issues in lunarmodules/lua_cliargs
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
cataclysmbn/Cataclysm-BN#10516 ·
Maintainers usually reply within 1 day
-
clangd_extensions.nvim and alabaster.nvim: "p00f" username now belongs to a different account (repo-jacking risk)Possibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
AstroNvim/astrocommunity#1802 ·
-
Bug era/hc Miscellaneous Task
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
-
engine priority: 3 - wishlist wontfix
Difficulty 1/5 Under an hour Newbie friendliness 90/100
panel-attack/panel-game#780 ·