Method: Yast::CommandLineClass#YesNo

Defined in:
library/commandline/src/modules/CommandLine.rb

#YesNoBoolean

Ask user, commandline equivalent of Popup::YesNo()

Returns:

  • (Boolean)

    true if user entered "yes"



1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
# File 'library/commandline/src/modules/CommandLine.rb', line 1655

def YesNo
  # prompt message displayed in the commandline mode
  # when user is asked to replay "yes" or "no" (localized)
  prompt = _("yes or no?")

  ui = UserInput(prompt)

  # yes - used in the command line mode as input text for yes/no confirmation
  yes = _("yes")

  # no - used in the command line mode as input text for yes/no confirmation
  no = _("no")

  ui = UserInput(prompt) while ui != yes && ui != no

  ui == yes
end