mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-03-04 07:06:39 +08:00
Add trimmed descriptions with complete command while parsing man pages.
This commit is contained in:
parent
a6ab66080e
commit
7ded90ae6a
@ -46,7 +46,7 @@ def printcompletecommand(cmdname, args, description):
|
|||||||
print "complete -c", cmdname,
|
print "complete -c", cmdname,
|
||||||
for arg in args:
|
for arg in args:
|
||||||
print arg,
|
print arg,
|
||||||
# print "--descripton ", description
|
print "--descripton '" + description + "'"
|
||||||
print "\n",
|
print "\n",
|
||||||
|
|
||||||
def builtcommand(options, description):
|
def builtcommand(options, description):
|
||||||
@ -61,6 +61,13 @@ def builtcommand(options, description):
|
|||||||
else:
|
else:
|
||||||
optionlist[i] = "-s " + optionlist[i][1:]
|
optionlist[i] = "-s " + optionlist[i][1:]
|
||||||
|
|
||||||
|
first_period = description.find(".")
|
||||||
|
# print "First period at: ", first_period
|
||||||
|
if first_period >= 45 or first_period == -1 and len(description) > 45:
|
||||||
|
description = description[:45] + "... [See Man Page]"
|
||||||
|
elif first_period >= 0:
|
||||||
|
description = description[:first_period]
|
||||||
|
|
||||||
printcompletecommand(CMDNAME, optionlist, description)
|
printcompletecommand(CMDNAME, optionlist, description)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user