Find a way to make sure the strings are closed off in case someone forgets to add a closing '\ or \".
Details
Diff Detail
- Repository
- rI IOSqueak
- Lint
Lint Not Applicable
Event Timeline
- Removed cout showing the values of various bools for checking for open/closed option strings.
- Feat: Fixed the help menu to display the description nicely. It now prints the command on the left, and word wraps the description.
iosqueak-source/src/blueshell/backspace.cpp | ||
---|---|---|
22 | This line is repeated at least 4 times, why not use something like this and make function calls instead? bool function (bool argument) { return ((argument) ? false: true); } |
@wdede
I have a question about what you think is best. I added it to the comment you made.
iosqueak-source/src/blueshell/backspace.cpp | ||
---|---|---|
22 | Did you think it is better to have the function take a reference and change it there, or return the value only? If the last one, would that not make changing my code of |
- Perf: Removed std::map<std::string, std::pair<std::pair<std::pair<std::string, std::string>, _register>, int>> as it was confusing trying to figure out how to access it (is it second.second.first, or second.second.second?). Replaced with struct, and made a map<string, struct_name>. Changed the other files to work with the new struct.
- Added file to register the default commands for the shell.
- Perf: Added cmd_map struct to seperate header, as the cppcheck linter was complaining about some un-used variable, even though it was used.
- Feat: Added the ability to use double tab at the end of the string, and not only the first word. Added a few other features.
The function would be written once and called as many times as needed. Basically, it is not really a repetition as the argument will be different every time.
Second, in my opinion, here there is no "need" to pass by reference, you can just pass the objects by value, I avoid messing with pointers and referenced values when not necessary. But feel free to experiment.
I found out I could just do a outer_single = !outer_single to swap it. I will just do that. No need for excess code and a function for that.
- Feat: Finished cmd_map header to replace map<pair<pair>>. Added the ability to use 'history' with a command search (eg. history test_attempt' would list only any history with test_attempt, and no others.
- Style: Changed for loop to transform because linter suggested it. Made various changes to the code to clean things up. Fixed issue with 'help <command name>' printing the container out in the wrong order.