File: make-cliff-works-with-cmd2-3.2.0.patch

package info (click to toggle)
python-cliff 4.13.2-2
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 740 kB
  • sloc: python: 5,408; makefile: 32; sh: 21
file content (25 lines) | stat: -rw-r--r-- 883 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
Description: Compat with cmd2 3.2.0
Author: Thomas Goirand <zigo@debian.org>
Forwarded: no
Last-Update: 2026-03-26

--- python-cliff-4.13.2.orig/cliff/interactive.py
+++ python-cliff-4.13.2/cliff/interactive.py
@@ -93,7 +93,16 @@ class InteractiveApp(cmd2.Cmd):
         This method returns cmd style and cliff style commands matching
         provided command prefix (text).
         """
-        completions = cmd2.Cmd.completenames(self, text)
+        if hasattr(cmd2.Cmd, "completenames"):
+            completions = cmd2.Cmd.completenames(self, text)
+        else:
+            # Fallback: replicate cmd.Cmd.completenames() behavior
+            completions = [
+                name[3:]
+                for name in dir(self)
+                if name.startswith("do_" + text)
+            ]
+
         completions += self._complete_prefix(text)
         return completions