Bug 1760587

Summary: odo incorrectly report invalid flag when a non existent command is used
Product: OpenShift Container Platform Reporter: Yana Hontyk <yhontyk>
Component: odoAssignee: Tomáš Král <tkral>
Status: CLOSED WONTFIX QA Contact: Amit <arout>
Severity: unspecified Docs Contact: Yana Hontyk <yhontyk>
Priority: unspecified    
Version: 4.2.0CC: cdrage, moahmed, oskutka
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Windows   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-12-10 13:44:27 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Yana Hontyk 2019-10-10 21:23:19 UTC
Description of problem:


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.  odo app create --project springproject jeffapp

Actual results:

Error: unknown flag: --project                                                                               
Usage:                                                                                                       
  odo app [flags]                                                                                            
  odo app [command]                                                                                          
                                                                                                             
Aliases:                                                                                                     
  app, application                                                                                           
                                                                                                             
Examples:                                                                                                    
  # Delete the application                                                                                   
  odo app delete myapp                                                                                       
  # Describe 'webapp' application,                                                                           
  odo app describe webapp                                                                                    
  # List all applications in the current project                                                             
  odo app list                                                                                               
                                                                                                             
  # List all applications in the specified project                                                           
  odo app list --project myproject                                                                           
                                                                                                             
Available Commands:                                                                                          
  delete      Delete the given application                                                                   
  describe    Describe the given application                                                                 
  list        List all applications in the current project                                                   
                                                                                                             
Flags:                                                                                                       
  -h, --help   Help for app                                                                                  
                                                                                                             
Global Flags:                                                                                                
      --skip-connection-check   Skip cluster check                                                           
  -v, --v Level                 Log level for V logs. Level varies from 0 to 9 (default 0).                  
      --vmodule moduleSpec      Comma-separated list of pattern=N settings for file-filtered logging         
                                                                                                             
Use "odo app [command] --help" for more information about a command.                                         
                                                                                                             
 X  unknown flag: --projec

Expected results:

Should report that the create command is not valid, not the --project flag incorrect

Additional info:

Comment 1 Tomáš Král 2019-12-10 13:44:27 UTC
We change this behavior we would have to change it in the Cobra library, which means either submitting path upstream or carrying our potched version. Both options are quite a lot o work, and I don't think it is worth investing in changing this.