@breadc/complete
TypeScript icon, indicating that this package has built-in type declarations

0.9.7 • Public • Published

@breadc/complete

version CI

👷 Work in progress.

Installation

npm i @breadc/complete

Add this plugin to your CLI script.

import breadc from 'breadc'
import complete from '@breadc/complete'

const cli = breadc('echo', { version: '1.0.0', plugins: [complete()] })
  .option('--host <host>', { default: 'localhost' })
  .option('--port <port>', { default: '3000', cast: p => +p })

cli
  .command('[message]', 'Say something!')
  .action((message, option) => {
    const host = option.host
    const port = option.port
    console.log(`Host: ${host}`)
    console.log(`Port: ${port}`)
  })

cli.run(process.argv.slice(2)).catch(err => console.error(err))

License

MIT License © 2023 XLor

Package Sidebar

Install

npm i @breadc/complete

Weekly Downloads

5

Version

0.9.7

License

MIT

Unpacked Size

11.2 kB

Total Files

8

Last publish

Collaborators

  • yjl9903