Skip to content

fix issue of parse_args not handling ':' in options correctly - #370

Closed
fotovlieger wants to merge 2 commits into
lunarmodules:masterfrom
fotovlieger:parse_args_problem
Closed

fotovlieger wants to merge 2 commits into
lunarmodules:masterfrom
fotovlieger:parse_args_problem

Conversation

@fotovlieger

Copy link
Copy Markdown

If an option contains ':', the parsed value is truncated
test:

--package.path  = '/home/hel/Penlight/lua/?.lua' .. ';' .. package.path
app=require 'pl.app'
pretty=require 'pl.pretty'
my_args = {'hello', '--flip=this', '--flop=that:zzz'}
args = app.parse_args(my_args)
print(pretty.write(args))

prints:

{
  flop = "that",
  flip = "this"
}

flop should be 'that:zzz'
Note: this is my first pull request ever, sure hope it works out :-)

Tieske added a commit that referenced this pull request Jan 29, 2021
Tieske added a commit that referenced this pull request Jan 29, 2021
@Tieske

Tieske commented Jan 29, 2021 •

Copy link
Copy Markdown
Member

thx @fotovlieger . I implemented it slightly differently in #373 by extending the splitv app to do "the right thing", and added some tests.

Thanks for your contribution!

@Tieske

Tieske commented Jan 29, 2021

Copy link
Copy Markdown
Member

replaced by #373

@Tieske Tieske closed this Jan 29, 2021
Tieske added a commit that referenced this pull request Jan 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants