[ruby/optparse] [DOC] Mention about post-check

e1957d7392
This commit is contained in:
Nobuyoshi Nakada 2025-03-10 16:53:16 +09:00 committed by git
parent 9e265b583b
commit 45e8dc1e85
2 changed files with 17 additions and 1 deletions

View file

@ -3,4 +3,10 @@ parser = OptionParser.new
parser.on('--xxx XXX', /foo/i, 'Matched values') do |value|
p ['--xxx', value]
end
parser.on('--yyy YYY', Integer, 'Check by range', 1..3) do |value|
p ['--yyy', value]
end
parser.on('--zzz ZZZ', Integer, 'Check by list', [1, 3, 4]) do |value|
p ['--zzz', value]
end
parser.parse!