OCA-Creations / Ally

A powerful command-line tool for managing ZSH aliases, written in Swift.
MIT License
2 stars 0 forks source link

[BUG] Docs are not removed correctly #7

Open MrDevel0per opened 10 months ago

MrDevel0per commented 10 months ago

Describe the bug When one runs ally remove on an alias with documentation added on the lines above, these lines of documentation are not properly removed; instead, they remain and are then incorrectly interpreted as docs for other commands.

Output First, create a sample .ally file:

# This is example documentation
alias example="echo Hello, World\!"
alias testTwo="echo TestTwo"

Now, run ally remove:

ally remove example
.Ally file has been resaved, and example is no longer available in the .ally file. To make these settings take effect for this terminal session, run
source ~/.ally

However, if one now executes ally list or looks at the contents of the ~/.ally file:

# This is example documentation
alias testTwo="echo TestTwo"

The alias is removed, but its docs were not.

To Reproduce Steps to reproduce the behavior:

  1. Add commands with docs to .ally file.
  2. Execute ally remove ALIAS_WITH_DOCUMENTATION
  3. Run ally list or cat ~/.ally
  4. See that docs for removed command still remain, and are incorrectly attributed to other commands.

Expected behavior The documentation should have been removed with the command when ally remove was run, leaving no docs left for the removed command.