Skip to content

Change Shell Handler Signature Completely #708

@LudwigKnuepfer

Description

@LudwigKnuepfer

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Community: good first issueThis issue is good for newcomers to RIOT to be addressed / implementedType: enhancementThe issue suggests enhanceable parts / The PR enhances parts of the codebase / documentationType: questionThe issue poses a question regarding usage of RIOT

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions