docs: def main(func=None, argv=None, input_stream=stdin, output_stream=stdout,
           error_stream=stderr, exit=True):
      """runs a function as a command.
      runs a function as a command - reading input from `input_stream`, writing
      output into `output_stream` and providing arguments from `argv`.
  
      Example Usage:
  
          >>> import cbox
          >>>
          >>> @cbox.cmd
          >>> def hello(name: str):
          >>>     print('hello {}!'.format(name))
          >>>
          >>> if __name__ == '__main__':
          >>>    cbox.main(hello)
  
      more examples on `README.md`
  
  
      :param callable func: the function to execute, must be decorated by
        `@cbox.cmd` or `@cbox.stream`.
      :param list[str] argv: command arguments (default `sys.argv`)
      :param input_stream: readable file-like object (default `stdin`)
      :param output_stream: writable file-like object (default `stdout`)
      :param error_stream: writable file-like object (default `stderr`)
      :param bool exit: if True, exits (i.e. `sys.exit(exitcode)`)
        with the `exitcode`, else returns the `exitcode`.
        the code is 0 if no errors, else 2.
      :return: the exit code if `exit` is False, else raises `SystemExit(code)`
      """
      executor = executors.get_func_executor(func)
      exitcode = executor(func, argv, input_stream, output_stream, error_stream)
  
      if exit:
          sys.exit(exitcode)
      return exitcode