c4spar / deno-cliffy

Command line framework for deno 🦕 Including Commandline-Interfaces, Prompts, CLI-Table, Arguments Parser and more...

Home Page:https://cliffy.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

feature request: return output from action handler

scarf005 opened this issue · comments

import { Command } from "https://deno.land/x/cliffy@v1.0.0-rc.3/command/mod.ts"

const { output } = await new Command().action(() => 1).parse()
console.log(output) // 1

afaik there's no way to retrieve return value from function passed to Command.action. being able to retrieve (and possibly typecheck its return type) would be useful.