code: def _get_usage(self):
          
          parser = argparse.ArgumentParser()
          parser.prog = 'juju-resources {}'.format(self.object_name)
          for set_name, set_args in getattr(self.object, '_subcommand_argsets', {}).items():
              for ap_args, ap_kwargs in set_args:
                  parser.add_argument(*ap_args, **ap_kwargs)
          for ap_args, ap_kwargs in getattr(self.object, '_subcommand_args', []):
              parser.add_argument(*ap_args, **ap_kwargs)
          usage = parser.format_usage()
          usage = re.sub(r'\n *', ' ', usage)
          return usage.strip()
docs: Build usage string from argparser args.