Q:

How to make 'optparse' print menu by default if no argument provided?

I build command line utility and I use optparse for parsing options.
For now I can display my menu only by typing prog_name -h. How to show menu when no arguments provided? I want just prog_name [ENTER] and menu appears.
Thanks in advance.

A:

Add this before you define your OptionParser:
ARGV << '-h' if ARGV.empty?

