getoptsの使い方メモ ref: http://qiita.com/hotoku/items/0c8d9a6c2e899d54a7cf