cb64103161b69d59e1efefeb761ac85564c44698

Author
Md Mushfiqur Rahim <20mahin2020@gmail.com>
Committer
GitHub <noreply@github.com>
Date

Message

fix(aliases): preserve trailing double quotes in als output (#13744)

Co-authored-by: Codebuff Contributor <contributor@codebuff.com>

Diff

 1diff --git a/plugins/aliases/cheatsheet.py b/plugins/aliases/cheatsheet.py
 2index 61bf5f956216f3d73471b28ecea8b271a75755f2..d4e35c4ee9621035bf5a935a714d9d455df827ba 100644
 3--- a/plugins/aliases/cheatsheet.py
 4+++ b/plugins/aliases/cheatsheet.py
 5@@ -6,7 +6,9 @@ import argparse
 6 
 7 def parse(line):
 8     left = line[0:line.find('=')].strip()
 9-    right = line[line.find('=')+1:].strip('\'"\n ')
10+    right = line[line.find('=')+1:].strip('\n ')
11+    if len(right) >= 2 and right[0] == right[-1] and right[0] in '\'"':
12+        right = right[1:-1]
13     try:
14         cmd = next(part for part in right.split() if len([char for char in '=<>' if char in part])==0)
15     except StopIteration: