! @brief Handle 'json' subcommand.

def do_json(self):
        """! @brief Handle 'json' subcommand."""
        # Default to listing probes.
        if (self._args.probes, self._args.targets, self._args.boards) == (False, False, False):
            self._args.probes = True
        
        # Create a session with no device so we load any config.
        session = Session(None,
                            project_dir=self._args.project_dir,
                            config_file=self._args.config,
                            no_config=self._args.no_config,
                            pack=self._args.pack,
                            **convert_session_options(self._args.options)
                            )
        
        if self._args.probes:
            obj = ListGenerator.list_probes()
            print(json.dumps(obj, indent=4))
        elif self._args.targets:
            # Create targets from provided CMSIS pack.
            if ('pack' in session.options) and (session.options['pack'] is not None):
                pack_target.PackTargets.populate_targets_from_pack(session.options['pack'])

            obj = ListGenerator.list_targets()
            print(json.dumps(obj, indent=4))
        elif self._args.boards:
            obj = ListGenerator.list_boards()
            print(json.dumps(obj, indent=4))