gazorby / fish-abbreviation-tips

💡 Help you remembering your abbreviations
MIT License
291 stars 7 forks source link

Add escape for string split #20

Closed soraxas closed 2 years ago

soraxas commented 2 years ago

Description

Add escape -- to the string split

See the following error:

string split: Unknown option “- 'cd -'”

~/.config/fish/fisher/functions/__abbr_tips_init.fish (line 1): 
string split -m1 ' ' "$abb[$i]"
^
in command substitution
    called on line 10 of file ~/.config/fish/fisher/functions/__abbr_tips_init.fish
in function '__abbr_tips_init'

If the abbreviation starts with - it will errors out. This PR adds -- to escape possible invalid string

Related issues

Notes

gazorby commented 2 years ago

Thanks @soraxas!