command/login: Add hostname to default token desc

Uses `Socket.gethostname` to add the current hostname to the default
description.
This commit is contained in:
Justin Campbell 2017-08-10 17:21:20 -04:00
parent 92578aed4b
commit 03ebd8b714
1 changed files with 3 additions and 1 deletions

View File

@ -1,3 +1,5 @@
require 'socket'
module VagrantPlugins
module LoginCommand
class Command < Vagrant.plugin("2", "command")
@ -59,7 +61,7 @@ module VagrantPlugins
password = @env.ui.ask("Password (will be hidden): ", echo: false)
end
description_default = "Vagrant login"
description_default = "Vagrant login from #{Socket.gethostname}"
while !description
description =
@env.ui.ask("Token description (Defaults to #{description_default.inspect}): ")