Description of problem: Exception is shown as below while using rhc tail with an invalid option. #rhc tail php1 -o '-test' /usr/local/share/gems/gems/commander-4.1.2/lib/commander/command.rb:169:in `parse_options_and_call_procs': missing argument: -o (OptionParser::MissingArgument) from /usr/local/share/gems/gems/commander-4.1.2/lib/commander/command.rb:155:in `run' from /usr/local/share/gems/gems/commander-4.1.2/lib/commander/runner.rb:402:in `run_active_command' from /usr/local/share/gems/gems/rhc-0.99.2/lib/rhc/command_runner.rb:55:in `run!' from /usr/local/share/gems/gems/commander-4.1.2/lib/commander/delegates.rb:11:in `run!' from /usr/local/share/gems/gems/rhc-0.99.2/lib/rhc/cli.rb:40:in `start' from /usr/local/share/gems/gems/rhc-0.99.2/bin/rhc:57:in `<top (required)>' from /usr/local/bin/rhc:23:in `load' from /usr/local/bin/rhc:23:in `<main>' Version-Release number of selected component (if applicable): fork_ami_openshift_US2814_US22816_160 How reproducible: always Steps to Reproduce: 1.Create an app 2.Tail app log with invalid option #rhc tail php1 -o '-test' Actual results: Exception as pasted in description is shown. Expected results: Noexception shown, but error message "Invalid option" pops up with rhc tail help content shown. Additional info:
I'm trying to reproduce this and I see different results: I am testing on RHEL6 with rhc-0.99.3 installed. [root@domU-12-31-39-16-55-DB ~]# rhc tail test -o '-test' missing argument: -o Usage: rhc tail <application> Tail the logs of an application Options for tail -n, --namespace namespace Namespace of your application -o, --opts options Options to pass to the server-side (linux based) tail command (applicable to tail command only) (-f is implicit. See the linux tail man page full list of options.) (Ex: --opts '-n 100') -f, --files files File glob relative to app (default <application_name>/logs/*) (optional) Global Options -l, --rhlogin login OpenShift login -p, --password password OpenShift password -d, --debug Turn on debugging --noprompt Do not ask for input --config FILE Path of a different config file -h, --help Display help documentation -v, --version Display version information -t, --trace Display backtrace when an error occurs
QE's result may be tested on Fedora17&ruby-1.9 and MacOS&ruby-1.9 and Ubuntu12&ruby-1.8
Okay, I'm able to reproduce the error when I upgrade to version 4.1.2 of the commander gem.
This is a conflict between the registered '-t' trace option and the '-test'. Option parser sees the (-t)set and stops parsing the option, then thinks the '-o' is missing a value and causes the exception: /usr/lib/ruby/1.8/optparse.rb:453:in `parse': missing argument: -o (OptionParser::MissingArgument)
https://github.com/J5/rhc/pull/12 This code is currently in my master and commands-merge-master branch https://github.com/calfonso/rhc Once the pull request is processed, J5's fork will have my changes. Feel free to test the fixes from my fork as well.
verified on devenv_2248, and building rhc package using repo git:calfonso/rhc.git step: 1.Create an app 2.Tail app log with invalid option rhc tail php1 -o '-x' Result : OpenShiftmatoMacBook-Pro:client OpenShift$ rhc tail php1 -o '-x' Password: ***** /usr/bin/tail: invalid option -- 'x' Try `/usr/bin/tail --help' for more information.