### Summary

`ansible-inventory --graph` can be specified with a group though, the output is not a JSON format so that we cannot parse the output easily.

It would be helpful for us if the `ansible-inventory --list` could accept the group name.


### Issue Type

Feature Idea

### Component Name

inventory

### Additional Information

For example, I created an inventory file.

```
[groupA]
host1
host2
host3

[groupA:children]
groupA1

[groupB]
host11
host12

[groupC]
host21
host22
host23
host24

[groupC:children]
groupA1

[groupA1]
host101
host102
host103
host104
host105
```

Then I can get filtered output with `ansible-inventory --graph`.  It can catch all hosts in the child group as well.

```
$ ansible-inventory -i inventory --graph groupA
@groupA:
  |--@groupA1:
  |  |--host101
  |  |--host102
  |  |--host103
  |  |--host104
  |  |--host105
  |--host1
  |--host2
  |--host3
```

However `ansible-inventory --list` performs to output only for the whole hosts in the inventory.  We need the filtered output as the `--graph` in a JSON format.


### Code of Conduct

- [X] I agree to follow the Ansible Code of Conduct
results = {}
            results[group.name] = {}
            results[group.name]['children'] = []
            for subgroup in group.child_groups:
                if subgroup.name == 'ungrouped' and not has_ungrouped:
                    continue
                if group.name != 'all':
                    results[group.name]['children'].append(subgroup.name)
                results.update(format_group(subgroup))
            if group.name != 'all':
                for host in group.hosts:
                    if host.name not in seen:
                        seen.add(host.name)
                        host_vars = self._get_host_variables(host=host)
                    else:
                        host_vars = {}
                    try:
                        results[group.name]['hosts'][host.name] = host_vars
                    except KeyError:
                        results[group.name]['hosts'] = {host.name: host_vars}
            if context.CLIARGS['export']:
                results[group.name]['vars'] = self._get_group_variables(group)
            self._remove_empty(results[group.name])
            if not results[group.name]:
                del results[group.name]
            return results
        results = format_group(top)
        return results
def main(args=None):