class String

def strip_heredoc

that amount of leading whitespace.
Technically, it looks for the least indented line in the whole string, and removes

the user would see the usage message aligned against the left margin.

end
USAGE
...
-h This message
Supported options are:

This command does such and such.
puts <<-USAGE.strip_heredoc
if options[:usage]

For example in

Strips indentation in heredocs.
def strip_heredoc
  indent = scan(/^[ \t]*(?=\S)/).min.try(:size) || 0
  gsub(/^[ \t]{#{indent}}/, '')
end