func listAvailable() {
	cfg, err := loadEmojiMap()
	if err != nil {
		log.Fatal("fatal: could not load config", err)
	}
	fmt.Println()
	var maxLen int
	keys := []string{}
	for key := range cfg.Words {
		keys = append(keys, key)
		if len(key) > maxLen {
			maxLen = len(key)
		}
	}
	sort.Strings(keys)
	var padVal int
	var displayKey string
	var value string
	for _, key := range keys {
		padVal = (maxLen - len(key)) + 2
		displayKey = rightPad(":"+key+":", " ", padVal)
		value = cfg.Words[key]
		fmt.Println(displayKey, value)
	}
	fmt.Println()
}
listAvailable shows the available mappings in alphabetical order
package main
import (
	"fmt"
	"io/ioutil"
	"log"
	"os"
	"sort"
	"strings"
	"github.com/BurntSushi/toml"
	"github.com/codegangsta/cli"
	"github.com/natefinch/atomic"
	"github.com/pborman/getopt"
)
var Version = "No Version Provided"
type Config struct {
	Words map[string]string `toml:"commitKinds"`
}
var pwd string
var hook = "\n# simplifies emoji usage \nlipstick \"`cat $1`\" > \"$1\""
func init() {
	var err error
	pwd, err = os.Getwd()
	if err != nil {
		log.Fatal(err)
	}
}
func install() {
	if _, err := os.Stat(pwd + "/.git"); err != nil {
		log.Fatal("fatal: Not a git repository (or any of the parent directories): .git")
	}
	f, err := os.OpenFile(pwd+"/.git/hooks/commit-msg", os.O_APPEND|os.O_WRONLY|os.O_CREATE, 0777)
	defer f.Close()
	_, werr := f.WriteString(hook)
	if werr != nil || err != nil {
		log.Fatal("fatal: unable to create the commit-msg hook!", werr, err)
	}
	log.Println("created hook for ", pwd)
}
func uninstall() {
	if _, err := os.Stat(pwd + "/.git"); err != nil {
		log.Fatal("fatal: Not a git repository (or any of the parent directories): .git")
	}
	f, err := os.Open(pwd + "/.git/hooks/commit-msg")
	d, rerr := ioutil.ReadAll(f)
	if err != nil || rerr != nil {
		log.Fatal("fatal: unable to remove commit-msg hook", rerr, err)
	}
	f.Close()
	old := string(d)
	new := strings.Replace(old, "\n# simplifies emoji usage", "", -1)
	new = strings.Replace(new, "\nlipstick \"`cat $1`\" > \"$1\"", "", -1)
	out := strings.NewReader(new)
	if err := atomic.WriteFile(pwd+"/.git/hooks/commit-msg", out); err != nil {
		log.Fatal("fatal: unable to remove commit-msg hook", err)
	}
}
func Run(c *cli.Context) {
	getopt.Parse()
	args := getopt.Args()
	msg := strings.Join(args, " ")
	cfg, err := loadEmojiMap()
	if err != nil {
		log.Fatal("fatal: could not load config", err)
	}
	if msg != "" {
		fmt.Println(replace(cfg, msg))
	} else {
		log.Fatal("fatal: no message given")
	}
}
func loadEmojiMap() (*Config, error) {
	cfg := &Config{}
	if _, err := loadLocalConfig(cfg); err != nil {
		if _, err := loadDefaultConfig(cfg); err != nil {
			return nil, err
		}
	}
	return cfg, nil
}
func loadLocalConfig(cfg *Config) (*Config, error) {
	if _, err := toml.DecodeFile(pwd+"/.lipstickrc", &cfg); err != nil {
		return nil, err
	}
	return cfg, nil
}
func loadDefaultConfig(cfg *Config) (*Config, error) {
	data, err := Asset("config/lipstickrc.toml")
	if err != nil {
		return nil, err
	}
	if _, err := toml.Decode(string(data), &cfg); err != nil {
		return nil, err
	}
	return cfg, nil
}
func replace(cfg *Config, msg string) string {
	for key, value := range cfg.Words {
		msg = strings.Replace(msg, ":"+key+":", value, -1)
	}
	return msg
}
func createConfig() {
	if _, err := os.Stat(".lipstickrc"); !os.IsNotExist(err) {
		log.Fatal("fatal: .lipstickrc exists")
	}
	data, err := Asset("config/lipstickrc.toml")
	if err != nil {
		log.Fatal("fatal: could not load default .lipstickrc", err)
	}
	r := strings.NewReader(string(data))
	if err := atomic.WriteFile(".lipstickrc", r); err != nil {
		log.Fatal("fatal: could not generate .lipstickrc", err)
	}
}