sshman 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sshman/sshman.rb +7 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 45eed8265f83e42f992e39d076c00e216eb27765de50c3a63027485000b2889e
|
4
|
+
data.tar.gz: ba5b30f2793966eba1d72d6cff27b0dc6823d631cc4c5d03330803e5e3e2d3d1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e65a3828a9a74032ce754caa0414638123613f3d79fcfe91ec36f3230f7224bc22b6dd824680887f1d1fb1488bcb2118110ac983784604add9e71d35f7c2b21a
|
7
|
+
data.tar.gz: cc8667dda8aa810581f7ecf21888a5902c133425d7872b8dafd412c7c9b4df0be31f7994481db755e9853dcf7a7f4b18279752efaca96f0b5bbcc6ae688c4f78
|
data/lib/sshman/sshman.rb
CHANGED
@@ -17,7 +17,7 @@ module Sshman
|
|
17
17
|
when 'delete'
|
18
18
|
new.delete_server
|
19
19
|
when 'connect'
|
20
|
-
new.connect_to_server
|
20
|
+
new.connect_to_server(argv[1])
|
21
21
|
when 'help'
|
22
22
|
new.display_help
|
23
23
|
when 'version'
|
@@ -191,11 +191,15 @@ HELP
|
|
191
191
|
end
|
192
192
|
|
193
193
|
# Connect to a server using SSH
|
194
|
-
def connect_to_server
|
194
|
+
def connect_to_server(alias_name = nil)
|
195
|
+
# If no alias is provided, ask the user for one
|
196
|
+
if alias_name.nil?
|
195
197
|
print "Enter alias of the server to connect: "
|
196
198
|
alias_name = gets.chomp.strip
|
199
|
+
end
|
200
|
+
|
201
|
+
# Search for the server in the CSV file
|
197
202
|
server = nil
|
198
|
-
|
199
203
|
CSV.foreach(SERVERS_CSV, headers: true) do |row|
|
200
204
|
if row['alias'] == alias_name
|
201
205
|
server = row
|