def parse(self, args):
    if (len(sys.argv) == 1):
        self.parser.print_help()
        self.parser.exit(1)
    if (args[1] == '--version'):
        print(VERSION)
        sys.exit(0)
    if ((not (args[1] in ['-h', '--help', '--version'])) and args[1].startswith('-')):
        _exit_if_errors([f"Unknown subcommand: '{args[1]}'. The first argument has to be a subcommand like 'bucket-list' or 'rebalance', please see couchbase-cli -h for the full list of commands and options"])
    l1_args = self.parser.parse_args(args[1:2])
    l2_args = l1_args.klass().parse(args[2:])
    setattr(l2_args, 'klass', l1_args.klass)
    return l2_args
def parse(self, args):
    if (len(sys.argv) == 1):
        self.parser.print_help()
        self.parser.exit(1)
    if (args[1] == '--version'):
        print(VERSION)
        sys.exit(0)
    if ((not (args[1] in ['-h', '--help', '--version'])) and args[1].startswith('-')):
        _exit_if_errors([f"Unknown subcommand: '{args[1]}'. The first argument has to be a subcommand like 'bucket-list' or 'rebalance', please see couchbase-cli -h for the full list of commands and options"])
    l1_args = self.parser.parse_args(args[1:2])
    l2_args = l1_args.klass().parse(args[2:])
    setattr(l2_args, 'klass', l1_args.klass)
    return l2_args