def parse_cli_args(): parser = argparse.ArgumentParser( description="Start broadcasting server for Mixer") add_logging_cli_args(parser) parser.add_argument("--port", type=int, default=common.DEFAULT_PORT) parser.add_argument("--log-server-updates", action="store_true") return parser.parse_args(), parser
def parse_cli_args(): parser = argparse.ArgumentParser(prog="cli", description="Command Line Interface for Mixer server") cli_utils.add_logging_cli_args(parser) sub_parsers = parser.add_subparsers() parser.add_argument("--host", help="Host name", default=common.DEFAULT_HOST) parser.add_argument("--port", help="Port", default=common.DEFAULT_PORT) parser.add_argument("--timeout", help="Timeout for server response", default=TIMEOUT) # Room commands are relative to... a room! room_parser = sub_parsers.add_parser("room", help="Rooms related commands") room_parser.add_argument( "command", help='Commands. Use "list" to list all the rooms of the server. Use "delete" to delete one or more rooms. Use "clear" to clear the commands stack of rooms. Use "clients" to list the clients connected to rooms.', choices=("list", "delete", "clear", "clients"), ) room_parser.add_argument( "name", help="Room name. You can specify multiple room names separated by spaces.", nargs="*" ) room_parser.set_defaults(func=process_room_command) # Client commands are relative to a client independently of any room client_parser = sub_parsers.add_parser("client", help="Clients related commands") client_parser.add_argument("command", help="", choices=("list")) client_parser.set_defaults(func=process_client_command) return parser.parse_args(), parser
def parse_cli_args(): parser = argparse.ArgumentParser(description="Start broadcasting server for Mixer") add_logging_cli_args(parser) parser.add_argument("--port", type=int, default=common.DEFAULT_PORT) parser.add_argument("--log-server-updates", action="store_true") parser.add_argument( "--bandwidth", type=float, default=0.0, help="simulate bandwidth limitation (megabytes per second)" ) parser.add_argument("--latency", type=float, default=0.0, help="simulate network latency (in milliseconds)") return parser.parse_args(), parser