Skip to content

Commit

Permalink
chore: add force argument on confirm function
Browse files Browse the repository at this point in the history
  • Loading branch information
MatteoGuadrini committed Feb 9, 2024
1 parent 882f3a4 commit b55f66d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,14 +259,18 @@ def make_symlink(source, destination):
warning("MS-DOS file system doesn't support symlink file")


def confirm(message, default="n"):
def confirm(message, default="n", force=False):
"""
Ask user to enter Y or N (case-insensitive).
:message: message to print
:default: default answer
:force: ignore prompt message
:return: True if the answer is Y.
:rtype: bool
"""
# If force, answer is "yes"
if force:
return True
while (
answer := input(
"{0}\nTo continue? {1} ".format(
Expand Down

0 comments on commit b55f66d

Please sign in to comment.