Completion is not working for application commands in interactive mode

Bug #1424053 reported by Cedric Brandily
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cliff
Fix Released
Medium
Cedric Brandily

Bug Description

In interactive mode, the completion only show cmd2 style methods (do__.*).

Typically in interactive mode, cliffdemo don't show simple command when you write s<Tab>:

$ cliffdemo

(cliffdemo) s
save set shell shortcuts show
(cliffdemo) help

Shell commands (type help <topic>):
===================================
cmdenvironment edit hi l list pause r save shell show
ed help history li load py run set shortcuts

Undocumented commands:
======================
EOF eof exit q quit

Application commands (type help <topic>):
=========================================
complete file help show file two part
error files list files simple unicode

(cliffdemo)

Changed in python-cliff:
assignee: nobody → Cedric Brandily (cbrandily)
Changed in python-cliff:
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cliff (master)

Fix proposed to branch: master
Review: https://review.openstack.org/157944

Changed in python-cliff:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cliff (master)

Reviewed: https://review.openstack.org/157944
Committed: https://git.openstack.org/cgit/openstack/cliff/commit/?id=103b9b88e4efb8ad668683181bbacc1879337778
Submitter: Jenkins
Branch: master

commit 103b9b88e4efb8ad668683181bbacc1879337778
Author: Cedric Brandily <email address hidden>
Date: Fri Feb 20 22:09:04 2015 +0100

    Correct completion in interactive mode

    Currently, in interactive mode, cliff shows cmd/cmd2 style
    commands[1] matching written prefix in completion list but not cliff
    style commands[2]:

    * for command prefix without completer delimiter, InteractiveAPP uses
      cmd completion method (completenames) and returns only cmd/cmd2 style
      command candidates,
    * for command prefix with completer delimiter, InteractiveAPP uses its
      completion method (completedefault) but with an incorrect filter and
      returns no or incorrect candidates.

    This change defines completenames method to add cliff style commands in
    completion and corrects completedefault method implementation.

    [1]: commands defined through a do_$method in $method InteractiveApp
         class or subclasses. By consequence, $method contains no completer
         delimiter.
    [2]: commands defined using cliff command-manager

    Change-Id: I84a64212acb305e5bfcf25282ad21a694a6826a9
    Closes-Bug: #1424053

Changed in python-cliff:
status: In Progress → Fix Committed
Changed in python-cliff:
milestone: none → 1.10.1
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.