Usage for Clipcode:


 clipcode [-r|-a|-d]   file   key
 clipcode -w  file   key   value
 clipcode {-l | -v} file
 clipcode -V

options:
  -r (default if no flag): READ value for given key
  -a: ADD key if it doesn't exist (if key created, created valueless)
  -d: DELETE (first occurrence of) key from file
  -w: WRITE value to given key
  -l: LIST all keynames in file (doesn't sort or check for duplicates)
  -v: VERIFY file for sanity- check for dupes, bizarre characters,
      reuse of : (confusing), lack of any : in non-comment lines, etc.
  -V: print VERSION and exit(hmm...)

output and exit status:
  READ has good exit status if it finds the key, bad otherwise.
    It prints any value found to stdout.
  ADD always has good exit status, and prints any key that was
    already there to stdout??? Unsure of what to do with this.
  DELETE has good exit status if it managed to delete key, bad
    otherwise. OR, could have it return the number of keys
    deleted (could be >1)?
  WRITE always has good exit status, and no output.
  LIST always has good exit status, and outputs each key found in
    the order they are found.
  VERIFY has good exit status if file is sane, bad otherwise.
    May have different levels of sanity giving different
    exit stati?

 NOTE: Will probably change these if there's file-opening errors (finding
  or writing, etc).
  Actually, should the dictionary file be created if it doesn't already
  exist, or should this cause an error?

 Yeah, I think missing dictionary files shouldn't be created, and should
  cause an error exit status.

 It's become clear that WRITE must either write a new dictionary to
  a temp file and then move it to the old copy, OR, delete the old
  copy of the key, and rewrite a new key at the end... The second
  isn't really suitable. Question is, what are the pitfalls of the
  second option? Does in damand file-locking? I think it would
  anyway. What's the stuff about "insecure" temp files that I keep
  hearing about? NB- the ADD command would also need file-locking,
  but not temp-files.

 WRITE doesn't actually always succeed, it should depend on the key
  already existing for simplicity's sake.

 Either spaces in keys should be illegal, or LIST should have an
  option to translate spaces into escape characters so scripts such as
    for KEY in `clipcode -l config.cfg`; do clipcode -r ;echo;done
  wouldn't get confused by them.

