def setup(self, shell):
        """Install auto-completions for the appropriate shell.

        Args:
            shell (str):
                String specifying name of shell for which auto-completions
                will be installed for.
        """
        system = platform.system()
        script = resource_string('rbtools', self.SHELLS[shell][system]['src'])
        dest = os.path.join(self.SHELLS[shell][system]['dest'],
                            self.SHELLS[shell][system]['filename'])

        try:
            with open(dest, 'w') as f:
                f.write(script)
        except __HOLE__ as e:
            logging.error('I/O Error (%s): %s' % (e.errno, e.strerror))
            sys.exit()

        print('Successfully installed %s auto-completions.' % shell)
        print('Restart the terminal for completions to work.')
dataset/ETHPy150Open reviewboard/rbtools/rbtools/commands/setup_completion.py/SetupCompletion.setup