Metadata-Version: 2.1
Name: ask-lib
Version: 2.0.0
Summary: Utility function to ask for user's confirmation in a CLI
License: MIT
Author: CallMePixelMan
Requires-Python: >=3.8,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Dist: pytest-cov (>=4.1.0,<5.0.0)
Description-Content-Type: text/markdown

<p align="center">
    <img src="./img/ask_lib_logo.png">
</p>

![](https://img.shields.io/pypi/l/ask_lib) 
![](https://img.shields.io/pypi/v/ask_lib) 
![](https://img.shields.io/pypi/pyversions/ask_lib)


# ask_lib
ask_lib is a small Python package available on PyPi that lets you ask user's confirmation from a [CLI](https://en.wikipedia.org/wiki/Command-line_interface).

## Documentation
ask_lib is well tested (with 100% test coverage).

## Examples
```py
from ask_lib import ask, AskResult


to_remove = "file.txt"

if ask("Are you sure to delete this file ?", AskResult.NO):
    os.remove(to_remove)
```
```py
import os
import sys

from ask_lib import ask, AskResult


yes_to_all = AskFlag.YES_TO_ALL if "-force" in sys.argv else None
to_remove = "file.txt"

if ask("Are you sure to delete this file ?", flag=yes_to_all):
    os.remove(to_remove)
```
