old_contents: import sys
  import click
  # Why does this file exist, and why __main__?
  # For more info, read:
  # - https://www.python.org/dev/peps/pep-0338/
  # - https://docs.python.org/2/using/cmdline.html#cmdoption-m
  # - https://docs.python.org/3/using/cmdline.html#cmdoption-m
  
  
  @click.command()
  @click.argument('names', nargs=-1)
  def main(names):
      click.echo(repr(names))
  
  if __name__ == "__main__":
      sys.exit(main())
  
new_contents: """
  The MIT License (MIT)
  
  Copyright (c) 2015 Joshua Lynch, Sarah Nicholas
  
  Permission is hereby granted, free of charge, to any person obtaining a copy
  of this software and associated documentation files (the "Software"), to deal
  in the Software without restriction, including without limitation the rights
  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  copies of the Software, and to permit persons to whom the Software is
  furnished to do so, subject to the following conditions:
  
  The above copyright notice and this permission notice shall be included in all
  copies or substantial portions of the Software.
  
  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  SOFTWARE.
  """
  # Why does this file exist, and why __main__?
  # For more info, read:
  # - https://www.python.org/dev/peps/pep-0338/
  # - https://docs.python.org/2/using/cmdline.html#cmdoption-m
  # - https://docs.python.org/3/using/cmdline.html#cmdoption-m
  import configparser
  import logging
  import io
  import sys
  
  import click
  
  from mrfitty.combination_fit import AllCombinationFitTask
  
  
  def get_config_parser():
      return configparser.ConfigParser(
          allow_no_value=True,
          delimiters=('=',)
      )
  
  @click.command()
  @click.argument('config_fp', type=click.Path(exists=True))
  def main(config_fp):
      log = logging.getLogger(name=__name__)
  
      config = get_config_parser()
      log.info('reading configuration file path: {}'.format(config_fp))
      with open(config_fp) as config_file:
          config.read_file(config_file)
  
      # log the configuration file
      with io.StringIO() as string_buffer:
          config.write(string_buffer)
          log.info('configuration file contents:\n{}'.format(string_buffer.getvalue()))
  
      fitter = AllCombinationFitTask.build(config)
      fitter.fit_all()
  
      table_file_path = config.get('output', 'table_fp', fallback=None)
      if table_file_path:
          log.info('writing table output to file path {}'.format(table_file_path))
          fitter.write_table(table_file_path)
      else:
          log.warning('No file path specified for table output')
  
      plots_pdf_file_path = config.get('output', 'plots_pdf_fp', fallback=None)
      if plots_pdf_file_path:
          log.info('writing plots to PDF {}'.format(plots_pdf_file_path))
          fitter.draw_plots(plots_pdf_file_path)
      else:
          log.warning('No file path specified for plot output')
  
      best_fit_files_dir_path = config.get('output', 'best_fit_files_dir', fallback=None)
      if best_fit_files_dir_path:
          fitter.write_best_fit_arrays(best_fit_files_dir_path)
      else:
          log.warning('No directory specified for best fit files')
  
  
  if __name__ == "__main__":
      logging.basicConfig(level=logging.INFO)
      sys.exit(main())
  
subject: support for configuration file