|
| 1 | +#compdef httpstatus |
| 2 | +# |
| 3 | +# httpstatus コマンド用zsh補完関数 |
| 4 | +# |
| 5 | +# このファイルfpathの通ったディレクトリに置きzshを再起動して下さい。 |
| 6 | +# その際ファイル名を必ず _httpstatus として下さい。 |
| 7 | +# |
| 8 | +# $ cp _httpstatus /usr/local/share/zsh/site-functions |
| 9 | +# $ exec zsh |
| 10 | +# |
| 11 | +# 代表的なfpathの通ったディレクトリ: |
| 12 | +# |
| 13 | +# /usr/share/zsh/site-functions/ |
| 14 | +# /usr/local/share/zsh/site-functions/ |
| 15 | +# |
| 16 | +# fpathの調べ方: |
| 17 | +# |
| 18 | +# $ echo $fpath | tr " " "\n" |
| 19 | +# |
| 20 | +# 他のコマンドでこの補完関数を使用する場合は、以下の設定を .zshrc などに追加して下さい: |
| 21 | +# |
| 22 | +# compdef _httpstatus <command> |
| 23 | +# |
| 24 | + |
| 25 | +function _httpstatus() { |
| 26 | + local httpstatus |
| 27 | + httpstatus="\ |
| 28 | +100[Continue] |
| 29 | +101[Switching Protocols] |
| 30 | +102[Processing] |
| 31 | +200[OK] |
| 32 | +201[Created] |
| 33 | +202[Accepted] |
| 34 | +203[Non-Authoritative Information] |
| 35 | +204[No Content] |
| 36 | +205[Reset Content] |
| 37 | +206[Partial Content] |
| 38 | +207[Multi-Status] |
| 39 | +208[Already Reported] |
| 40 | +300[Multiple Choices] |
| 41 | +301[Moved Permanently] |
| 42 | +302[Found] |
| 43 | +303[See Other] |
| 44 | +304[Not Modified] |
| 45 | +305[Use Proxy] |
| 46 | +307[Temporary Redirect] |
| 47 | +400[Bad Request] |
| 48 | +401[Unauthorized] |
| 49 | +402[Payment Required] |
| 50 | +403[Forbidden] |
| 51 | +404[Not Found] |
| 52 | +405[Method Not Allowed] |
| 53 | +406[Not Acceptable] |
| 54 | +407[Proxy Authentication Required] |
| 55 | +408[Request Timeout] |
| 56 | +409[Conflict] |
| 57 | +410[Gone] |
| 58 | +411[Length Required] |
| 59 | +412[Precondition Failed] |
| 60 | +413[Request Entity Too Large] |
| 61 | +414[Request-URI Too Large] |
| 62 | +415[Unsupported Media Type] |
| 63 | +416[Request Range Not Satisfiable] |
| 64 | +417[Expectation Failed] |
| 65 | +418[I'm a teapot] |
| 66 | +422[Unprocessable Entity] |
| 67 | +423[Locked] |
| 68 | +424[Failed Dependency] |
| 69 | +425[No code] |
| 70 | +426[Upgrade Required] |
| 71 | +428[Precondition Required] |
| 72 | +429[Too Many Requests] |
| 73 | +431[Request Header Fields Too Large] |
| 74 | +449[Retry with] |
| 75 | +500[Internal Server Error] |
| 76 | +501[Not Implemented] |
| 77 | +502[Bad Gateway] |
| 78 | +503[Service Unavailable] |
| 79 | +504[Gateway Timeout] |
| 80 | +505[HTTP Version Not Supported] |
| 81 | +506[Variant Also Negotiates] |
| 82 | +507[Insufficient Storage] |
| 83 | +509[Bandwidth Limit Exceeded] |
| 84 | +510[Not Extended] |
| 85 | +511[Network Authentication Required] |
| 86 | +701[Meh] |
| 87 | +702[Emacs] |
| 88 | +703[Explosion] |
| 89 | +710[PHP] |
| 90 | +711[Convenience Store] |
| 91 | +712[NoSQL] |
| 92 | +719[I am not a teapot] |
| 93 | +720[Unpossible] |
| 94 | +721[Known Unknowns] |
| 95 | +722[Unknown Unknowns] |
| 96 | +723[Tricky] |
| 97 | +724[This line should be unreachable] |
| 98 | +725[It works on my machine] |
| 99 | +726[It's a feature, not a bug] |
| 100 | +727[32 bits is plenty] |
| 101 | +731[Fucking Rubygems] |
| 102 | +732[Fucking Unic💙de] |
| 103 | +733[Fucking Deadlocks] |
| 104 | +734[Fucking Deferreds] |
| 105 | +735[Fucking IE] |
| 106 | +736[Fucking Race Conditions] |
| 107 | +737[FuckThreadsing] |
| 108 | +738[Fucking Bundler] |
| 109 | +739[Fucking Windows] |
| 110 | +740[Computer says no] |
| 111 | +741[Compiling] |
| 112 | +742[A kitten dies] |
| 113 | +743[I thought I knew regular expressions] |
| 114 | +744[Y U NO write integration tests?] |
| 115 | +745[I don't always test my code, but when I do I do it in production] |
| 116 | +746[Missed Ballmer Peak] |
| 117 | +747[Motherfucking Snakes on the Motherfucking Plane] |
| 118 | +748[Confounded by Ponies] |
| 119 | +749[Reserved for Chuck Norris] |
| 120 | +750[Didn't bother to compile it] |
| 121 | +753[Syntax Error] |
| 122 | +754[Too many semi-colons] |
| 123 | +755[Not enough semi-colons] |
| 124 | +759[Unexpected T_PAAMAYIM_NEKUDOTAYIM] |
| 125 | +761[Hungover] |
| 126 | +762[Stoned] |
| 127 | +763[Under-Caffeinated] |
| 128 | +764[Over-Caffeinated] |
| 129 | +765[Railscamp] |
| 130 | +766[Sober] |
| 131 | +767[Drunk] |
| 132 | +768[Accidentally Took Sleeping Pills Instead Of Migraine Pills During Crunch Week] |
| 133 | +769[Questionable Maturity Level] |
| 134 | +771[Cached for too long] |
| 135 | +772[Not cached long enough] |
| 136 | +773[Not cached at all] |
| 137 | +774[Why was this cached?] |
| 138 | +776[Error on the Exception] |
| 139 | +777[Coincidence] |
| 140 | +778[Off By One Error] |
| 141 | +779[Off By Too Many To Count Error] |
| 142 | +780[Project owner not responding] |
| 143 | +781[Operations] |
| 144 | +782[QA] |
| 145 | +783[It was a customer request, honestly] |
| 146 | +784[Management, obviously] |
| 147 | +785[TPS Cover Sheet not attached] |
| 148 | +786[Try it now] |
| 149 | +791[The Internet shut down due to copyright restrictions.] |
| 150 | +792[Climate change driven catastrophic weather event] |
| 151 | +793[Zombie Apocalypse] |
| 152 | +794[Someone let PG near a REPL] |
| 153 | +797[This is the last page of the Internet. Go back] |
| 154 | +799[End of the world]" |
| 155 | + |
| 156 | + local -a comp_list |
| 157 | + comp_list=(${(f)httpstatus}) |
| 158 | + _values 'http status' "$comp_list[@]" |
| 159 | +} |
| 160 | + |
| 161 | +_httpstatus "$@" |
0 commit comments