MCPcopy Index your code
hub / github.com/python-cmd2/cmd2 / do_eat

Method do_eat

tests/test_cmd2.py:1511–1517  ·  view source on GitHub ↗

Eat something, with a selection of sauces to choose from.

(self, arg)

Source from the content-addressed store, hash-verified

1509
1510class SelectApp(cmd2.Cmd):
1511 def do_eat(self, arg) -> None:
1512 """Eat something, with a selection of sauces to choose from."""
1513 # Pass in a single string of space-separated selections
1514 sauce = self.select("sweet salty", "Sauce? ")
1515 result = "{food} with {sauce} sauce, yum!"
1516 result = result.format(food=arg, sauce=sauce)
1517 self.stdout.write(result + "\n")
1518
1519 def do_study(self, arg) -> None:
1520 """Learn something, with a selection of subjects to choose from."""

Callers

nothing calls this directly

Calls 2

selectMethod · 0.80
writeMethod · 0.45

Tested by

no test coverage detected