from .settings import BongSettings, DEFAULT_MESSAGE
from .metadata import VERSION, SUMMARY
import argparse

PARSER = argparse.ArgumentParser(description=SUMMARY)
PARSER.add_argument('-V', '--version', action='version', version=VERSION,
                    help='Show version')
PARSER.add_argument('-s', '--short-break', action='store_const', const=5,
                    dest='minutes', default=25,
                    help='Time for a Pomodoro system short break')
PARSER.add_argument('-l', '--long-break', action='store_const',
                    const=15, dest='minutes',
                    help='Time for a Pomodoro system long break')
PARSER.add_argument('-p', '--pomodoro', action='store_const',
                    const=25, dest='minutes',
                    help='Time for a Pomodoro system single Pomodoro')
PARSER.add_argument('-t', '--time', action='store', type=int, dest='minutes',
                    help='Timer length, in minutes')
PARSER.add_argument('-m', '--message', default=DEFAULT_MESSAGE,
                    help='Message to display in the notifier')


def parse_args(args):
    settings = PARSER.parse_args(args)
    return BongSettings(time=60*settings.minutes, message=settings.message)

from .settings import BongSettings, DEFAULT_MESSAGE
from .metadata import VERSION, SUMMARY
import argparse

PARSER = argparse.ArgumentParser(description=SUMMARY)
PARSER.add_argument('-V', '--version', action='version',
                    version='%(prog)s {}'.format(VERSION),
                    help='show version')
PARSER.add_argument('-s', '--short-break', action='store_const', const=5,
                    dest='minutes', default=25,
                    help='time for a Pomodoro system short break')
PARSER.add_argument('-l', '--long-break', action='store_const',
                    const=15, dest='minutes',
                    help='time for a Pomodoro system long break')
PARSER.add_argument('-p', '--pomodoro', action='store_const',
                    const=25, dest='minutes',
                    help='time for a Pomodoro system single Pomodoro')
PARSER.add_argument('-t', '--time', action='store', type=int, dest='minutes',
                    help='timer length, in minutes')
PARSER.add_argument('-m', '--message', default=DEFAULT_MESSAGE,
                    help='message to display in the notifier')


def parse_args(args):
    settings = PARSER.parse_args(args)
    return BongSettings(time=60*settings.minutes, message=settings.message)

Clean up the argument parsing
Clean up the argument parsing

  from .settings import BongSettings, DEFAULT_MESSAGE
  from .metadata import VERSION, SUMMARY
  import argparse
  
  PARSER = argparse.ArgumentParser(description=SUMMARY)
- PARSER.add_argument('-V', '--version', action='version', version=VERSION,
+ PARSER.add_argument('-V', '--version', action='version',
+                     version='%(prog)s {}'.format(VERSION),
-                     help='Show version')
+                     help='show version')
  PARSER.add_argument('-s', '--short-break', action='store_const', const=5,
                      dest='minutes', default=25,
-                     help='Time for a Pomodoro system short break')
+                     help='time for a Pomodoro system short break')
  PARSER.add_argument('-l', '--long-break', action='store_const',
                      const=15, dest='minutes',
-                     help='Time for a Pomodoro system long break')
+                     help='time for a Pomodoro system long break')
  PARSER.add_argument('-p', '--pomodoro', action='store_const',
                      const=25, dest='minutes',
-                     help='Time for a Pomodoro system single Pomodoro')
+                     help='time for a Pomodoro system single Pomodoro')
  PARSER.add_argument('-t', '--time', action='store', type=int, dest='minutes',
-                     help='Timer length, in minutes')
+                     help='timer length, in minutes')
  PARSER.add_argument('-m', '--message', default=DEFAULT_MESSAGE,
-                     help='Message to display in the notifier')
+                     help='message to display in the notifier')
  
  
  def parse_args(args):
      settings = PARSER.parse_args(args)
      return BongSettings(time=60*settings.minutes, message=settings.message)
  
Clean up the argument parsing
## Code Before:
from .settings import BongSettings, DEFAULT_MESSAGE
from .metadata import VERSION, SUMMARY
import argparse

PARSER = argparse.ArgumentParser(description=SUMMARY)
PARSER.add_argument('-V', '--version', action='version', version=VERSION,
                    help='Show version')
PARSER.add_argument('-s', '--short-break', action='store_const', const=5,
                    dest='minutes', default=25,
                    help='Time for a Pomodoro system short break')
PARSER.add_argument('-l', '--long-break', action='store_const',
                    const=15, dest='minutes',
                    help='Time for a Pomodoro system long break')
PARSER.add_argument('-p', '--pomodoro', action='store_const',
                    const=25, dest='minutes',
                    help='Time for a Pomodoro system single Pomodoro')
PARSER.add_argument('-t', '--time', action='store', type=int, dest='minutes',
                    help='Timer length, in minutes')
PARSER.add_argument('-m', '--message', default=DEFAULT_MESSAGE,
                    help='Message to display in the notifier')


def parse_args(args):
    settings = PARSER.parse_args(args)
    return BongSettings(time=60*settings.minutes, message=settings.message)

## Instruction:
Clean up the argument parsing
## Code After:
from .settings import BongSettings, DEFAULT_MESSAGE
from .metadata import VERSION, SUMMARY
import argparse

PARSER = argparse.ArgumentParser(description=SUMMARY)
PARSER.add_argument('-V', '--version', action='version',
                    version='%(prog)s {}'.format(VERSION),
                    help='show version')
PARSER.add_argument('-s', '--short-break', action='store_const', const=5,
                    dest='minutes', default=25,
                    help='time for a Pomodoro system short break')
PARSER.add_argument('-l', '--long-break', action='store_const',
                    const=15, dest='minutes',
                    help='time for a Pomodoro system long break')
PARSER.add_argument('-p', '--pomodoro', action='store_const',
                    const=25, dest='minutes',
                    help='time for a Pomodoro system single Pomodoro')
PARSER.add_argument('-t', '--time', action='store', type=int, dest='minutes',
                    help='timer length, in minutes')
PARSER.add_argument('-m', '--message', default=DEFAULT_MESSAGE,
                    help='message to display in the notifier')


def parse_args(args):
    settings = PARSER.parse_args(args)
    return BongSettings(time=60*settings.minutes, message=settings.message)
