From dc63d83ded3babfb5e2bfed74caf5a0b548afd34 Mon Sep 17 00:00:00 2001 From: Asdine El Hrychy Date: Fri, 16 Sep 2022 10:51:45 +0800 Subject: [PATCH] Improve usage --- README.md | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f7ca12d..71dcfcf 100644 --- a/README.md +++ b/README.md @@ -2,14 +2,31 @@ cueimports is a [CUE](https://github.com/cue-lang/cue) tool that updates your import lines, adding missing ones and removing unused ones. +It scans through: + +- your local packages +- the cue.mod directory packages +- the standard library packages + ## Install -``` +```bash go install github.com/asdine/cueimports/cmd/cueimports ``` ## Usage ```bash -cueimports [path ...] +$ echo "data: json.Marshal({a: math.Sqrt(7)})" | cueimports +``` + +``` +package hello + +import ( + "encoding/json" + "math" +) + +data: json.Marshal({a: math.Sqrt(7)}) ```