Skip to content

Latest commit

 

History

History
33 lines (28 loc) · 882 Bytes

README.md

File metadata and controls

33 lines (28 loc) · 882 Bytes

@/command-line

Provides a framework for creating command line tools using Alterior. Naturally this is the command line handling library for the Alterior CLI, but it can be used for any sort of command line tool you might need to build.

Getting Started

// src/main.ts

import PKG = require('../package.json');
let line = new CommandLine()
    .info({
        executable: 'my-tool',
        description: 'An example CLI application',
        copyright: 'Copyright 2023 Me',
        version: PKG.version
    })
    .command('frobulate', cmd => {
        cmd .info({
                description: 'Frobulate the given value',
                argumentUsage: '<value>'
            })
            .run(([ value ]) => {
                console.log(`You have frobulated ${value}!`);
            })
        ;
    })
    .run(() => line.showHelp());
;

line.process();