import { program } from "https://deno.land/x/[email protected]/mod.ts";
// father
program
.name("Lovely")
.version("1.0.0")
.description("I like my app.")
// Option Defination: -alias,-alias,--name:type, default type is string
// Subcommand inherits it's father command's option.
.option("-d,--debug:boolean", "Debug my app.");
// Only string and boolean works!
// child
program
// Command Defination: name|alias|alias <required_parameter> [optional_parameter]
.command("new|n <name> [where]", "Have a new lovely.")
// Set current command as default command.
.defaultCommand()
// "red" is the default value for "--color" if not specified.
.option("--color:string", "What color do you like?", "red")
// requiredOption must be specified so that it doesn't have a default value.
.requiredOption("--confirm:boolean", "Are you sure?")
// define the callback function which takes a all-in-one object.
.action((args) => {
console.log("Here you are the lovely!");
console.log(args);
});
// run!
program
.parse();
-
Notifications
You must be signed in to change notification settings - Fork 0
License
skanfd/deno-bark
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
License
Stars
Watchers
Forks
Packages 0
No packages published