Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Cygwin の cygports を有効にしたり、無効にしたりを簡単に切り替える。 centos の enable-repo 的なことができないので、手動で切り替える。
#coding: utf-8
require 'optparse'
iij = ""
cygports = ""
target = nil
opt =
opt.on("-d","--disable", "cygwin 標準(cygports無効)" ){|v| target = iij}
opt.on("-e","--enable", "cygports を有効にする"){|v| target = cygports}
opt.parse! ARGV
unless target then
ARGV = ["--help"]
opt.parse! ARGV
#puts target
IO.foreach("|/usr/bin/apt-cyg -m #{target} update ") {|line|puts line}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment