Skip to content

Commit

Permalink
new fqdn autocomplete for external apps
Browse files Browse the repository at this point in the history
  • Loading branch information
Chas Wareing committed Dec 19, 2013
1 parent d3a0ce4 commit 48b0d31
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
5 changes: 4 additions & 1 deletion README
@@ -1,8 +1,11 @@
'Ash' v0.2
'Ash' v0.3
http://github.com/c3w/ash

DEMO VIDEO @ http://www.youtube.com/watch?v=OH6QmnTeoEg&feature=youtube_gdata_player

2013DEC20 c3w
. added ash_helper_fqdn to provide auto-complete to other network-y apps, such as ssh
. complete -W "$(~/bin/ash_helper_fqdn)" ssh
2013AUG13 c3w
. added example Terminal profiles
. added a csv importer that accepts: shortname,fqdn,profile type
Expand Down
24 changes: 24 additions & 0 deletions ash_helper_fqdn
@@ -0,0 +1,24 @@
#!/usr/bin/env ruby

require 'json'

ashrc = ENV['HOME'] + "/.ashrc"
$tunnel = ""
host = ARGV[0]
$default_profile = "Pro"

f = File.open(ashrc, 'r')
json = f.read
hash = JSON.parse(json)

stuff = hash.select{|key, hash| key=""}

stuff.each do|k,v|
v.each do|key, value|
case key
when "fqdn"
puts value
end
end
end

0 comments on commit 48b0d31

Please sign in to comment.