Skip to content

Commit

Permalink
Added a command to clear current session
Browse files Browse the repository at this point in the history
  • Loading branch information
zeekay committed Jan 16, 2012
1 parent a905451 commit b02ad29
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions ff.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ def list_sessions():
for s in itersessions(include_saved=True):
print s[0], s[1]


# commands
def list_command(args):
if args.tabs:
Expand Down Expand Up @@ -141,6 +142,10 @@ def open_command(args):
def save_command(args):
save_session()

def clear_command(args):
profile, session = next(itersessions())
os.remove(session)


if __name__ == '__main__':
# make sure config dir exists
Expand All @@ -161,6 +166,10 @@ def save_command(args):
save_parser = subparsers.add_parser('save', help='Save current session')
save_parser.set_defaults(command=save_command)

# clear command
clear_parser = subparsers.add_parser('clear', help='Clear current session')
clear_parser.set_defaults(command=clear_command)

# read command
read_parser = subparsers.add_parser('read', help='Read idx')
read_parser.add_argument('idx', action='store', help='Index of article to read')
Expand Down

0 comments on commit b02ad29

Please sign in to comment.