loam/cli.py
def _build_parser(self):
        """Build command line argument parser.

        Returns:
            :class:`argparse.ArgumentParser`: the command line argument parser.
            You probably won't need to use it directly. To parse command line
            arguments and update the :class:`ConfigurationManager` instance
            accordingly, use the :meth:`parse_args` method.
        """
        main_parser = argparse.ArgumentParser(description=self.common.help,
                                              prefix_chars='-+')

        self._add_options_to_parser(self._opt_bare, main_parser)
        main_parser.set_defaults(**self.common.defaults)
        if self.bare is not None:
            main_parser.set_defaults(**self.bare.defaults)

        subparsers = main_parser.add_subparsers(dest='loam_sub_name')
        for cmd_name, meta in self.subcmds.items():
            kwargs = {'prefix_chars': '+-', 'help': meta.help}
            dummy_parser = subparsers.add_parser(cmd_name, **kwargs)
            self._add_options_to_parser(self._opt_cmds[cmd_name], dummy_parser)
            dummy_parser.set_defaults(**meta.defaults)

        return main_parser
def _build_parser(self):
        main_parser = argparse.ArgumentParser(description=self.common.help,
                                              prefix_chars='-+')

        self._add_options_to_parser(self._opt_bare, main_parser)
        main_parser.set_defaults(**self.common.defaults)
        if self.bare is not None:
            main_parser.set_defaults(**self.bare.defaults)

        subparsers = main_parser.add_subparsers(dest='loam_sub_name')
        for cmd_name, meta in self.subcmds.items():
            kwargs = {'prefix_chars': '+-', 'help': meta.help}
            dummy_parser = subparsers.add_parser(cmd_name, **kwargs)
            self._add_options_to_parser(self._opt_cmds[cmd_name], dummy_parser)
            dummy_parser.set_defaults(**meta.defaults)

        return main_parser
def _build_parser ( self ) : main_parser = argparse . ArgumentParser ( description = self . common . help , prefix_chars = '-+' ) self . _add_options_to_parser ( self . _opt_bare , main_parser ) main_parser . set_defaults ( * * self . common . defaults ) if self . bare is not None : main_parser . set_defaults ( * * self . bare . defaults ) subparsers = main_parser . add_subparsers ( dest = 'loam_sub_name' ) for cmd_name , meta in self . subcmds . items ( ) : kwargs = { 'prefix_chars' : '+-' , 'help' : meta . help } dummy_parser = subparsers . add_parser ( cmd_name , * * kwargs ) self . _add_options_to_parser ( self . _opt_cmds [ cmd_name ] , dummy_parser ) dummy_parser . set_defaults ( * * meta . defaults ) return main_parser
Build command line argument parser.

        Returns:
            :class:`argparse.ArgumentParser`: the command line argument parser.
            You probably won't need to use it directly. To parse command line
            arguments and update the :class:`ConfigurationManager` instance
            accordingly, use the :meth:`parse_args` method.
Build command line argument parser .