File tree Expand file tree Collapse file tree 3 files changed +8
-6
lines changed
picoruby-shell/shell_executables Expand file tree Collapse file tree 3 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -223,7 +223,8 @@ def start
223223 history_head
224224 when 4 # Ctrl-D logout
225225 puts
226- return
226+ puts "^D\e [0J"
227+ raise "Abort"
227228 when 5 # Ctrl-E
228229 @buffer . tail
229230 when 9
Original file line number Diff line number Diff line change @@ -57,8 +57,8 @@ def ask(prompt, allow_empty: false)
5757 break buffer . lines [ 0 ] . chomp
5858 end
5959 end
60- answer = q . default . to_s if answer . empty?
61- break if !answer . empty? || allow_empty
60+ answer = q . default . to_s if answer . to_s . empty?
61+ break if !answer . to_s . empty? || allow_empty
6262 end
6363 return ( @answer = answer )
6464 end
Original file line number Diff line number Diff line change 2020 tag + ciphertext
2121end
2222
23+ puts "Ctrd-D to exit"
2324cli = PicoLine . new
2425answers = { "wifi" => { } }
2526
2829end
2930answers [ "wifi" ] [ "ssid" ] = cli . ask ( "WiFi SSID?" )
3031password = cli . ask ( "WiFi Password? (leave blank if no password required)" , allow_empty : true )
31- answers [ "wifi" ] [ "encoded_password" ] = if !password . empty?
32- Base64 . encode64 ( encrypt_proc . call ( password ) )
33- else
32+ answers [ "wifi" ] [ "encoded_password" ] = if password . nil? || password . empty?
3433 nil
34+ else
35+ Base64 . encode64 ( encrypt_proc . call ( password ) )
3536end
3637answers [ "wifi" ] [ "auto_connect" ] = cli . ask ( "Auto Connect? (y/n)" ) do |q |
3738 q . default = "y"
You can’t perform that action at this time.
0 commit comments