⚲
Project
General
Profile
Sign in
Register
Home
Projects
Help
Search
:
Ruby master
All Projects
Ruby
»
Ruby master
Overview
Activity
Roadmap
Issues
Repository
Like
Download (340 Bytes)
Bug #19566
» ruby-op-uri-bug.rb
jgomo3 (Jesús Gómez)
, 03/31/2023 10:56 PM
#!/usr/bin/env ruby
require
'optionparser'
require
'uri'
input
=
[
"--uri"
,
"http://example.com/"
]
results
=
{}
op
=
OptionParser
.
new
op
.
on
(
"--uri URI"
,
URI
,
"According to OptionParser doc, 'Anything accepted by URI.parse'"
)
do
|
v
|
results
[
:uri
]
=
v
end
op
.
parse
(
input
)
puts
"Input:
#{
input
[
1
]
}
"
puts
"Parsed:
#{
results
[
:uri
]
}
"
« Previous
1
2
Next »
(1-1/2)
Loading...