def parse_cmd_args(cmd_str):
    """Parse command name and arguments from user input"""
    cmd_str = cmd_str.strip().split(" ")
    cmd = cmd_str[0]
    pos_args = [] # Positional arguments
    flags = [] # Flags

    if len(cmd_str) > 1:
        args = cmd_str[1:]
        for arg in args:
            if arg[0:2] == '--' or arg[0] == '-':
                flags.append(arg)
            else:
                pos_args.append(arg)

    return cmd, pos_args, flags