From 4e1c4d678914c195d2195ac4ac4b4ea7053fbbc8 Mon Sep 17 00:00:00 2001 From: Nathan Stilwell Date: Wed, 27 Jul 2016 17:53:55 -0400 Subject: [PATCH] add some stuff to atlas --- plugins/atlas/atlas.plugin.zsh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/plugins/atlas/atlas.plugin.zsh b/plugins/atlas/atlas.plugin.zsh index f9959bde7..db3270875 100644 --- a/plugins/atlas/atlas.plugin.zsh +++ b/plugins/atlas/atlas.plugin.zsh @@ -43,6 +43,24 @@ function atlas_map { fi } +function atlas_show { + if [ -d "/Users/nstilwell/.hosts" ] && [ -e "/Users/nstilwell/.hosts/$1" ]; then + head -n 4 /etc/hosts; + else + echo "Atlas not initialized"; + atlas_usage; + fi +} + +function atlas_list { + if [ -d "/Users/nstilwell/.hosts" ] && [ -e "/Users/nstilwell/.hosts/$1" ]; then + ls ~/.hosts; + else + echo "Atlas not initialized"; + atlas_usage; + fi +} + function atlas { if [ -z "$1" ]; then atlas_usage; @@ -50,5 +68,7 @@ function atlas { [ "$1" = "new" ] && atlas_new "$2"; [ "$1" = "init" ] && atlas_init; [ "$1" = "map" ] && atlas_map "$2"; + [ "$1" = "show" ] && atlas_show; + [ "$1" = "list" ] && atlas_list; fi }