mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-14 14:03:58 +00:00
webconfig: Teach set_color short options
Since we now have .theme files we can't rely on it being normalized.
This commit is contained in:
parent
ba0b7133ad
commit
5a46a61ffb
1 changed files with 14 additions and 6 deletions
|
@ -197,21 +197,29 @@ def parse_color(color_str):
|
|||
for comp in comps:
|
||||
# Remove quotes
|
||||
comp = comp.strip("'\" ")
|
||||
if comp == "--bold":
|
||||
if comp == "--bold" or comp == "-o":
|
||||
bold = True
|
||||
elif comp == "--underline":
|
||||
elif comp == "--underline" or comp == "-u":
|
||||
underline = True
|
||||
elif comp == "--italics":
|
||||
elif comp == "--italics" or comp == "-i":
|
||||
italics = True
|
||||
elif comp == "--dim":
|
||||
elif comp == "--dim" or comp == "-d":
|
||||
dim = True
|
||||
elif comp == "--reverse":
|
||||
elif comp == "--reverse" or comp == "-r":
|
||||
reverse = True
|
||||
elif comp.startswith("--background="):
|
||||
elif comp.startswith("--background"):
|
||||
# Background color
|
||||
background_color = better_color(
|
||||
background_color, parse_one_color(comp[len("--background=") :])
|
||||
)
|
||||
elif comp.startswith("-b"):
|
||||
# Background color in short.
|
||||
skip = len("-b")
|
||||
if comp[len("-b=")] in ["=", " "]:
|
||||
skip += 1
|
||||
background_color = better_color(
|
||||
background_color, parse_one_color(comp[skip :])
|
||||
)
|
||||
else:
|
||||
# Regular color
|
||||
color = better_color(color, parse_one_color(comp))
|
||||
|
|
Loading…
Reference in a new issue