Last active
May 18, 2019 15:50
-
-
Save TrinityCoder/c1c011f12c54c8ee8a1121bc9c2a21cd to your computer and use it in GitHub Desktop.
This is the original Ruby script just slightly adjusted so that it runs with today's Ruby. ORIGINAL: https://github.com/textmate/cmake.tmbundle/blob/926867a414c1125abefa38161d82d71756f591a2/Support/arg_separators.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env -vS ruby -wKU | |
commands = `/usr/bin/env cmake --help-command-list`.lines | |
commands.shift # Skip version number | |
constants = [] | |
commands.each do |cmd| | |
cmd = cmd.strip.upcase | |
help = `/usr/bin/env cmake --help-command #{cmd}` | |
help.scan(/[a-zA-Z_]+\((.+?)\)/m) do |example| | |
example[0].scan(/[A-Z_\d]{2,}/) do |constant| | |
constants << constant | |
end | |
end | |
end | |
constants.uniq.sort.each { |constant| puts constant } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment