Skip to content

Commit

Permalink
close, but not quite finished
Browse files Browse the repository at this point in the history
  • Loading branch information
gazayas committed Nov 13, 2016
1 parent 08a98a5 commit a6eac1f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion http
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ IFS=$'\n'
if [ -z $1 ]; then
echo 'Type a number like "http 200" to see what protocol it is,'
echo 'or type "http -l" for the master list'
exit 1
fi

statuses=(
Expand Down Expand Up @@ -85,6 +86,10 @@ YELLOW='\033[0;33m'
NC='\033[0m' # No Color

function colors () {
if [ $# -eq 0 ]; then
echo "No arguments supplied"
exit 1
fi
if [[ "$i" =~ ^1 ]]; then
printf "${CYAN}${i}${NC}\n"
elif [[ "$i" =~ ^2 ]]; then
Expand All @@ -103,7 +108,7 @@ function colors () {
if [ $1 ]; then
for i in ${statuses[@]};
do
if [[ "$i" =~ "${1}" ]]; then
if [[ "$i" =~ ^"${1}" ]]; then
colors $i
fi
done
Expand All @@ -117,3 +122,5 @@ if [[ $1 =~ "-l" ]]; then
colors i
done
fi

exit 0
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#http

A command line tool for looking up http protocols
A command line tool for looking up http statuses

##Installation
`$ curl -o /usr/local/bin/http https://raw.githubusercontent.com/gazayas/http/master/http` <br/>
Expand Down

0 comments on commit a6eac1f

Please sign in to comment.