### 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
help="When doing --list, send the inventory to a file instead of to the screen")
        
        
    def post_process_args(self, options):
        options = super(InventoryCLI, self).post_process_args(options)
        display.verbosity = options.verbosity
        self.validate_conflicts(options)
        
        used = 0
        for opt in (options.list, options.host, options.graph):
            if opt:
                used += 1
        if used == 0:
            raise AnsibleOptionsError("No action selected, at least one of --host, --graph or --list needs to be specified.")
        elif used > 1:
            raise AnsibleOptionsError("Conflicting options used, only one of --host, --graph or --list can be used at the same time.")
        
        if options.args:
            options.pattern = options.args
        else:
            options.pattern = 'all'
        return options
    def run(self):
        super(InventoryCLI, self).run()
        
        self.loader, self.inventory, self.vm = self._play_prereqs()
        results = None
        if context.CLIARGS['host']:
            hosts = self.inventory.get_hosts(context.CLIARGS['host'])
            if len(hosts) != 1: