mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-05 16:21:15 -03:00
webconfig.py: simplify "functions" output parsing
This outputs one-item-per-line if stdout is a terminal.
This commit is contained in:
@@ -815,12 +815,7 @@ class FishConfigHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
|
||||
def do_get_functions(self):
|
||||
out, err = run_fish_cmd("functions")
|
||||
out = out.strip()
|
||||
|
||||
# Not sure why fish sometimes returns this with newlines
|
||||
if "\n" in out:
|
||||
return out.split("\n")
|
||||
else:
|
||||
return out.strip().split(", ")
|
||||
return out.split("\n")
|
||||
|
||||
def do_get_variable_names(self, cmd):
|
||||
"Given a command like 'set -U' return all the variable names"
|
||||
|
||||
Reference in New Issue
Block a user