Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Ally is unable to handle multi-line commands #1

Open
MrDevel0per opened this issue Sep 25, 2023 · 0 comments
Open

[BUG] Ally is unable to handle multi-line commands #1

MrDevel0per opened this issue Sep 25, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@MrDevel0per
Copy link
Contributor

MrDevel0per commented Sep 25, 2023

Ally does not specifically prohibit the use of multi-line arguments when using add or any other command. However, a multi-line command is not properly removed when using remove, is not properly executed or encapsulated with quotes in .ally, and causes an Index Out Of Range Error (which should probably be checked first) on list. This is outputted as: Swift/ContiguousArrayBuffer.swift:600: Fatal error: Index out of range, and occurs on these lines:

//It's an alias!
print(currentLine)
let parts = currentLine.split(separator: "=").map { sub in
String(sub)
}
var firstPart = parts[0]
let firstPartFifthIndex = firstPart.index(firstPart.startIndex, offsetBy: 5)
firstPart = String(firstPart[firstPartFifthIndex...])
firstPart = firstPart.replacingOccurrences(of: "alias ", with: "").trimmingCharacters(in: .whitespacesAndNewlines)
let secondPart = parts[1]

More specifically, on line 73, where we get the second index ([1]) of parts. To summarize, we must choose one of the following:

Option One: Prohibit multiline arguments

Option Two: Handle Multiline Arguments

The details for these will be updated soon.

@MrDevel0per MrDevel0per changed the title Ally is unable to handle multi-line commands [BUG] Ally is unable to handle multi-line commands Sep 25, 2023
@MrDevel0per MrDevel0per added the bug Something isn't working label Sep 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant