Skip to main content
Module

x/cliffy/examples/command/custom_option_type_class_completion.ts

Command line framework for deno 🦕 Including Commandline-Interfaces, Prompts, CLI-Table, Arguments Parser and more...
Extremely Popular
Go to Latest
File
#!/usr/bin/env -S deno run
import { Command, StringType } from "../../command/mod.ts";
class EmailType extends StringType { complete(): string[] { return ["aaa@example.com", "bbb@example.com", "ccc@example.com"]; }}
await new Command() .option("-e, --email <value:email>", "Your email address.") .type("email", new EmailType()) .parse(Deno.args);