Commonly used Ruby command-line switches
SwitchDescriptionExample of usage
-cChecks the syntax of a program file without executing the programruby -c c2f.rb
-wGives warning messages during program executionruby -w c2f.rb
-eExecutes the code provided in quotation marks on the command lineruby -e ‘puts “Code demo!”‘
-lLine mode: prints a newline after every line of outputruby -le ‘print “+ newline!”‘
-rnameRequires the named featureruby –rprofile
-vShows Ruby version information and executes the program in verbose moderuby –v
–versionShows Ruby version informationruby –-version
-hShows information about all command-line switches for the interpreterruby –h

Author codeByPasha

More posts by codeByPasha

Leave a Reply

All rights reserved Salient.