| 1234567891011121314151617181920 |
- """
- Prompting CLI utilities
- @author: olivier.massot, 05-2020
- """
- def ask_confirmation(msg):
- """ Ask confirmation to the user with the given message.
- Returns True if the user confirmed
- """
- msg += "\nWould you like to continue? (yes/no)"
- while 1:
- answer = input(msg)
- if answer in ('oui', 'yes', 'y', 'o'):
- return True
- elif answer in ('non', 'no', 'n'):
- return False
- else:
- msg = "The answer could'nt be understood. Continue? (yes/no)"
|