Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pl.lapp converting arguments ending with numbers to _ #26

Closed
rjpcomputing opened this issue May 8, 2012 · 2 comments
Closed

pl.lapp converting arguments ending with numbers to _ #26

rjpcomputing opened this issue May 8, 2012 · 2 comments
Assignees

Comments

@rjpcomputing
Copy link
Contributor

When updating from Penlight 0.8.x to 1.0.1 our scripts broke because our argument ended in a number. For an example lapp string see below. Notice the --premake4. It converts automatically the premake4 to premake_ which is unexpected.

lapp string example

local args = lapp [[
    Builds the current project. Run from the root level.

    -t,--target         (string)            One of the following: vs2005, vs2008, gnu, or gmake.
    -b,--build          (default Release)   Project-specific build configuration, usually Debug or Release.
    -i,--installer      (default none)      One of the following: inno or nsis.
    -f,--installerfile  (default none)      The installer source file to pass to the installer, if needed.
    -p,--premake        (default none)      Extra options passed on to premake.
    -m,--teamcity       (default true)      Enable teamcity output.
    -c,--clean                              Clean project sources before building.
    -q,--premake4                           Use premake4
    ]]
@ghost ghost assigned stevedonovan May 8, 2012
@rjpcomputing
Copy link
Contributor Author

I think I have a fix for this as well. The gsub() pattern was for everything but alpha characters, but it should be everything but alphanumeric characters.

lapp.lua@208

optparm = res.long:gsub('%A','_') -- so foo-bar becomes foo_bar in Lua

Changes To

optparm = res.long:gsub('%W','_') -- so foo-bar becomes foo_bar in Lua

@stevedonovan
Copy link
Contributor

Thanks, man - well spotted! I've pushed this change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants