-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Change Shell Handler Signature Completely #708
Copy link
Copy link
Closed
Labels
Community: good first issueThis issue is good for newcomers to RIOT to be addressed / implementedThis issue is good for newcomers to RIOT to be addressed / implementedType: enhancementThe issue suggests enhanceable parts / The PR enhances parts of the codebase / documentationThe issue suggests enhanceable parts / The PR enhances parts of the codebase / documentationType: questionThe issue poses a question regarding usage of RIOTThe issue poses a question regarding usage of RIOT
Description
To increase similarity with regular shells, the handler signature could be changed to
int handler(int argc, char **argv);.
The return value 0 would indicate success, anything else would be treated as an error.
The shell would need to be changed to iterate over the whole string with strtok, counting the parameters and to check the return value of the handler. If an error occurred the shell could print a message.
All shell commands would need to be updated for the new signature.
Pros:
- shell commands can communicate errors more easily (just return 1)
- no need for use of the unfamiliar strtok within the commands
- easier portability of existing commands
Cons:
- commands loose the ability to sscanf through parameters expecting spaces
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Community: good first issueThis issue is good for newcomers to RIOT to be addressed / implementedThis issue is good for newcomers to RIOT to be addressed / implementedType: enhancementThe issue suggests enhanceable parts / The PR enhances parts of the codebase / documentationThe issue suggests enhanceable parts / The PR enhances parts of the codebase / documentationType: questionThe issue poses a question regarding usage of RIOTThe issue poses a question regarding usage of RIOT