Skip to content

Instantly share code, notes, and snippets.

@TrinityCoder
Last active May 18, 2019 15:50

Revisions

  1. TrinityCoder revised this gist May 18, 2019. No changes.
  2. TrinityCoder revised this gist May 18, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion arg_separators.rb
    Original file line number Diff line number Diff line change
    @@ -7,7 +7,7 @@

    commands.each do |cmd|
    cmd = cmd.strip.upcase
    help = `/usr/local/bin/cmake --help-command #{cmd}`
    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
  3. TrinityCoder revised this gist May 18, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion arg_separators.rb
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    #!/usr/bin/env -vS ruby -wKU

    commands = `/usr/local/bin/cmake --help-command-list`.lines
    commands = `/usr/bin/env cmake --help-command-list`.lines
    commands.shift # Skip version number

    constants = []
  4. TrinityCoder created this gist May 11, 2019.
    18 changes: 18 additions & 0 deletions arg_separators.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    #!/usr/bin/env -vS ruby -wKU

    commands = `/usr/local/bin/cmake --help-command-list`.lines
    commands.shift # Skip version number

    constants = []

    commands.each do |cmd|
    cmd = cmd.strip.upcase
    help = `/usr/local/bin/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 }