From be086a580026dc87f569d32e35dcc3fe8a6d33c8 Mon Sep 17 00:00:00 2001 From: fpetrakov Date: Sun, 28 Aug 2022 10:37:31 +0300 Subject: [PATCH] add description to --help --- package.json | 2 +- src/index.js | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 673d268..cd944d1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "convert-to-oklch", - "version": "1.0.7", + "version": "1.0.8", "description": "CLI tool that converts rgb(), rgba(), hex, hsl() and hsla() colors to oklch() in specified CSS files.", "main": "./src/index.js", "bin": { diff --git a/src/index.js b/src/index.js index b36601c..aff4017 100755 --- a/src/index.js +++ b/src/index.js @@ -1,11 +1,19 @@ #!/usr/bin/env node const { program } = require("commander"); +const packageVersion = require("../package.json").version; const postcss = require("postcss"); const fs = require("fs"); const plugin = require("./plugin"); +program + .name("convert-to-oklch") + .description( + "CLI tool that converts rgb(), rgba(), hex, hsl() and hsla() colors to oklch() in specified CSS files.", + ) + .version(packageVersion); + program.argument("", "path to css files").action(async (path) => { - const css = fs.readFileSync(path, 'utf-8'); + const css = fs.readFileSync(path, "utf-8"); const result = await postcss([plugin]) .process(css, { from: path })