-
Configure drgn.
./mod.tsimport drgn from 'https://deno.land/x/drgn@v0.11.1/mod.ts' import greet from './commands/greet.ts' new drgn({ name: 'greeter', version: '0.1.0', // current version checkUpdate: { // optional, can also be a function registry: 'deno.land', moduleName: 'greeter', }, }) .command('greet', greet) .run()
-
Create a command.
./commands/greet.tsimport { command, z } from 'https://deno.land/x/drgn@v0.11.1/mod.ts' export default command('Greet somebody.', { name: { alias: 'n', schema: z.string().min(1).max(32), }, }, (ctx) => { console.log(`Hey, ${ctx.arg('name')}!`) })
-
Run it.
deno run ./mod.ts greet --name Tom # Hey, Tom!
This repository was archived by the owner on Dec 10, 2023. It is now read-only.
boywithkeyboard-archive/drgn_cli_deno
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|
 |  | |||
 |  | |||
 |  | |||
 |  | |||
 |  | |||
 |  | |||
 |  | |||
 |  | |||
 |  | |||
 |  | |||
 |  | |||
 |  | |||
 |  | |||
 |  | |||
 |  | |||
 |  | |||
 |  | |||
 |  | |||
 |  | |||