1.0.0 • Published 2 years ago

@fordi-org/get-options v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

getOptions

Quick library for grabbing command line options.

Usage

const { usage, read } = getOptions({
  description: 'My CLI app',
  A: {
    description: 'Do it to them all',
    trigger: () => ({ all: true }),
  },
});
type MyCLIOptions = {
  all?: boolean;
};

const { usage, read } = getOptions<MyCLIOptions>({
  description: 'My CLI app',
  A: {
    description: 'Do it to them all',
    trigger: () => ({ all: true }),
  },
});

See included types for details on the spec.