846d3b5 vshCommandOpt: Do more checking if skipChecks is set

Authored and Committed by mprivozn 6 years ago
1 file changed. 10 lines added. 10 lines removed.
    vshCommandOpt: Do more checking if skipChecks is set
    
    Currently if cmd->skipChecks is set (done only from completers)
    some basic checks are skipped because we're working over
    partially parsed command. See a26ff63ae4 for more detailed
    explanation. Anyway, the referenced commit was too aggressive in
    disabling checks and effectively returned success even in clear
    case of failure. For instance:
    
      # domif-getlink --interface <TAB><TAB>
    
    causes virshDomainInterfaceCompleter() to be called, which calls
    virshDomainGetXML() which eventually calls
    vshCommandOptStringReq(.., name = "domain"); The --domain
    argument is required for the command and if not present -1 should
    be returned to tell the caller the argument was not found. Well,
    zero is returned meaning the argument was not found but it's not
    required either.
    
    Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
    
        
file modified
+10 -10