Class: DInstallerCli::Commands::User

Inherits:
Thor
  • Object
show all
Defined in:
lib/dinstaller_cli/commands/user.rb

Overview

Subcommand to manage first user settings

Instance Method Summary collapse

Instance Method Details

#clearObject



54
55
56
# File 'lib/dinstaller_cli/commands/user.rb', line 54

def clear
  client.remove_first_user
end

#set(name) ⇒ Object



34
35
36
37
38
39
# File 'lib/dinstaller_cli/commands/user.rb', line 34

def set(name)
  client.create_first_user(name,
    fullname:  options[:fullname],
    password:  options[:password],
    autologin: options[:autologin])
end

#showObject



42
43
44
45
46
47
48
49
50
51
# File 'lib/dinstaller_cli/commands/user.rb', line 42

def show
  full_name, name, autologin = client.first_user

  return if name.empty?

  say("Full Name: #{full_name}\n" \
      "Name: #{name}\n" \
      "Autologin: #{autologin ? "yes" : "no"}\n" \
      "Password: <secret>")
end