Print confirmation feedback in `add` on success.

This commit is contained in:
William Melody 2015-09-11 19:47:52 -07:00
parent 12d11c2dc3
commit 590d75096f
1 changed files with 7 additions and 0 deletions

7
hosts
View File

@ -685,10 +685,17 @@ add() {
"${ip}" \
"${hostname}" \
"${formatted_comment}" >> "${HOSTS_PATH}"
printf "Added:\n%s\t%s\t# %s\n" \
"${ip}" \
"${hostname}" \
"${formatted_comment}"
else
printf "%s\t%s\n" \
"${ip}" \
"${hostname}" >> "${HOSTS_PATH}"
printf "Added:\n%s\t%s\n" \
"${ip}" \
"${hostname}"
fi
fi
}