Building CLIs that Click

Sponsored · Ship Features Fearlessly Turn features on and off without deploys. Used by thousands of Ruby developers. →

Building CLIs that Click

PyNash presentation on building better CLIs

Jason Myers

May 29, 2015

Annual Pro sale · Save $30

Have presentations of your own?

Share with private links, password protection, and more control over your work.

Transcript

29 slides
  1. IMPORTANT PARTS NAME ARGUMENT PARSING AND VALIDATION * HELP GENERATION

    * COMMAND STRUCTURE * AUTOCOMPLETION NICE OUTPUT PACKAGING *
  2. 2015-05-28 09:25:18,711 - complex.logger - DEBUG - Creating composit e:

    cookies 2015-05-28 09:25:18,711 - complex.logger - DEBUG - Created composite : cookies
  3. format_string = '%(asctime)s - %(name)s - ' \ '%(levelname)s -

    %(message)s' formatter = logging.Formatter(format_string) file_log_handler.setFormatter(formatter) stderr_log_handler.setFormatter(formatter)
  4. FIND OUR MODULE from setuptools import setup, find_packages setup( name='complex',

    version='0.1.2', packages=find_packages(), include_package_data=True,
  5. description='A description', classifiers=[ 'License :: OSI Approved :: BSD License',

    'Programming Language :: Python', 'Programming Language :: Python :: 3', ],

More Decks by Jason Myers

Other Decks in Technology