#!/usr/bin/env python

import sys
import tnotes

try:
    index = int(sys.argv[1])
except:
    index = 0
text = tnotes.read(index)
newtext = tnotes.enter(text)
tnotes.edit(index, newtext)