Conversation
There was a problem hiding this comment.
I'm yet to fully understand what this function does. Could you throw more light on this?
There was a problem hiding this comment.
- Right, so the
str_arr_sizefunction can be used to get the length of aNULLterminated string array. - After tokenizing a string into a string array, we can utilize this function to find how many strings exist in the array.
- For instance, in the
aliasExecutorfunction I'm currently working on, I can use this function to find the length of any string array returned by thestrtowfunction. - I will be using the
strtowfunction heavily, and it would be useful to know the length of the returned string array - particularly when writingifconditions
There was a problem hiding this comment.
Another team will be handling the tokenizer function #9 so you could rest on this one unless you have a specific use case.
You can check out their tokenizer function to learn more about how it could fit into your needs.
There was a problem hiding this comment.
- Alright boss, thanks. I'll look into their function. However, their
tokenizefunction can only help create the string array. It does not provide thesizeof the array for future use. - The
str_arr_sizefunction will help count the number of strings present in a string array that's returned from thetokenizefunction, which I will need in my function implementation.
Refactored 'key' to 'name' Corrected some syntax errors
… passed from the shell main file
There was a problem hiding this comment.
You might want to check your line 16 well...
Also, I'd like to believe memory is correctly handled in your code logic.
There was a problem hiding this comment.
Also, in your addAlias() function, you keep adding to the beginning of the list which will influence how the list of aliases is printed out when the command alias is issued without arguments. Utilize the tail pointer, it also gives you an O(1) runtime.
Currently, your code logic does not account for when alias is issued without arguments. Look into that, it's supposed to print the list of aliases in that case.
There was a problem hiding this comment.
Compare how sh prints the aliases, it doesn't include the alias keyword in the output. Handle the errors properly with the right error codes and messages. Consult with sh.
There was a problem hiding this comment.
Also, in your addAlias() function, you keep adding to the beginning of the list which will influence how the list of aliases is printed out when the command alias is issued without arguments. Utilize the tail pointer, it also gives you an O(1) runtime.
Currently, your code logic does not account for when alias is issued without arguments. Look into that, it's supposed to print the list of aliases in that case.
There was a problem hiding this comment.
Compare how sh prints the aliases, it doesn't include the alias keyword in the output. Handle the errors properly with the right error codes and messages. Consult with sh.
Debugged addAlias function taking into account the tail member of an aliasList Adjusted aliasExecutor function to account for changes in initAlias, and addAlias functions Corrected other errors in alias.c
There was a problem hiding this comment.
I have concerns with the alias functions...
Could you share a screenshot of the result after testing this function?
Also, share the file that you used for the testing.
There was a problem hiding this comment.
Alright boss.
addAlias git commit -m
…uments tokenizeAliasArguments handleAliasCommands handleAlias main
…ionality printAliasList freeAlias freeAliasList freeTokens
I added the first three auxiliary functions required to implement an aliasExecutor function that is yet to be programmed.
I also added a function that finds the length of a string array - a basic word counter - which will be of utility when building the aliasExecutor function.