1. Trevor Caira
  2. timebook


James Hartzell  committed b44ef3c

More error-checking

  • Participants
  • Parent commits 36f9728
  • Branches default

Comments (0)

Files changed (1)

File timebook/commands.py

View file
  • Ignore whitespace
         switch(db, [sheet])
         sheet = dbutil.get_current_sheet(db)
+    if opts.resume and args:
+        parser.error('"--resume" already sets a note, and is incompatible \
+with arguments.')
     timestamp = cmdutil.parse_date_time_or_now(opts.at)
     if opts.out:
         clock_out(db, timestamp=timestamp)
     parser.add_option('-a', '--at', dest='at',
                       help='Set time of clock-out')
     opts, args = parser.parse_args(args=args)
+    if args:
+        parser.error('"t out" takes no arguments.')
     clock_out(db, opts.at, opts.verbose)
 def clock_out(db, at=None, verbose=False, timestamp=None):