mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-23 06:05:39 +08: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
|
@ -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 New Issue
Block a user