Closed TheodorJ closed 6 years ago
looks cool! The new alias map seems like a straightforward way of dealing with aliases. Part of the redundancy I was referring to yesterday was checking if a valid command exists in the info_map when getting its usage string. Now that we loop through info_map directly, there's no need to query the map for the command_info any more since we get it by default with the iterator. I've updated the code with what I mean. (with some minor style changes to be more concise).
Before merging though, the seemingly random amount of spaces in the usage strings are kind of annoying... Now that the strings are all spread out, it's going to be quite hard to align them if we add additional commands in the future. I'm going to try and get them aligned...
Sounds like something we can automate -- the length of the string of spaces is equal to the longest command plus one character
ah that's true. I guess we could do that. I was originally going to propose a dead simple list initialization But I guess doing it dynamically inside print_help() works too (that's actually how the help text for the individual commands are generated rn). The only problem is we have to somehow reverse the alias_map.
Just tested -h, everything still works