2024-11-02 22:35:20 +01:00
|
|
|
import argparse
|
|
|
|
import typing as t
|
|
|
|
|
|
|
|
from . import generate
|
|
|
|
|
|
|
|
|
|
|
|
def pwgen_fr():
|
|
|
|
choices_map: dict[str, t.Callable[[], str]] = {
|
|
|
|
"phrase4": generate.gen_phrase4,
|
|
|
|
"phrase6": generate.gen_phrase6,
|
|
|
|
"rand4": lambda: generate.gen_rand(n=4),
|
2024-12-10 21:49:09 +01:00
|
|
|
"rand6": lambda: generate.gen_rand(n=6),
|
2024-11-02 22:35:20 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
parser = argparse.ArgumentParser()
|
|
|
|
parser.add_argument(
|
|
|
|
"mode", choices=choices_map.keys(), help="Select the generation procedure used"
|
|
|
|
)
|
|
|
|
|
|
|
|
args = parser.parse_args()
|
|
|
|
|
|
|
|
print(choices_map[args.mode]())
|