Skip to content

Usage examples

rudicode edited this page Oct 10, 2014 · 4 revisions

Usage Info

code2rubylearning version: 0.1.6

Usage: code2rubylearning [options] file1 file2 ...
    -s, --stdout                     Output to stdout
    -f, --nofilenames                Suppress filename line in output
    -p, --noprglink                  Suppress program link line in output
    -l, --linenumbers                Add line number option to code header
    -h, --help                       Display help screen
    -v, --version                    Display version information
Convert and Copy single file to clipboard.
code2rubylearning FILE1
Convert and Copy multiple files to clipboard.
code2rubylearning FILE1 FILE2 FILE3
Convert and Copy multiple files to clipboard. Also show output in terminal STDOUT
code2rubylearning --stdout FILE1 FILE2 FILE3

or

    code2rubylearning -s FILE1 FILE2 FILE3
Convert and Copy multiple files to clipboard. Don't display the file name.
code2rubylearning --nofilenames FILE1 FILE2 FILE3

or

code2rubylearning -f FILE1 FILE2 FILE3
Convert and Copy output from a piped program.( *nix based systems )

Try this:

ls -lah | code2rubylearning -s -f /dev/stdin

This will take the output of ls -lah which displays your current directory contents, and apply the conversion and then copy it to the clip board.

ruby ruby_script.rb | code2rubylearning -s -f /dev/stdin

This will display and copy to clipboard the output of your ruby script ready to paste to the forum.