 {exec}  = require "child_process"
 os      = require "os"
 
+# Bang is program for storing and retrieving text snippets
+# on the command line.
 module.exports = class Bang
+  # Initializes Bang's data store.
   constructor: ->
     @data = @getData()
 
+  # Entry point for the CLI. Processes arguments and delegates
+  # to the appropriate methods.
   start: (args) ->
     program = new Command
 

    else
      {}

  log: (args...) ->
    console.log args...

  save: ->
    fs.writeFileSync @dataPath, JSON.stringify(@data)

  get: (key) ->
    value = @data[key]
    return unless value

    @log value
    value

  # Set the value of a key.
  set: (key, value) ->
    @data[key] = value
    @save()
    this

  # Delete a key.
  delete: (key) ->
    delete @data[key]
    @save()
    this

  # List all keys and their values.
  list: ->
    amount = 0

