diff options
author | Wassim Chegham <1699357+manekinekko@users.noreply.github.com> | 2022-02-17 01:00:50 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-17 01:00:50 +0300 |
commit | 9275856eb75e7c394a3c7617c2b495aba35ee2de (patch) | |
tree | b68f4bff83ea27460496216b5c14fb79f86f01d1 | |
parent | fb13bdaf12dde3ef5685a77354e51a9cfa579879 (diff) |
docs: update usage example for npm pkg (#4424)
Add example for setting array values
Fixes #4320
-rw-r--r-- | lib/commands/pkg.js | 2 | ||||
-rw-r--r-- | tap-snapshots/test/lib/load-all-commands.js.test.cjs | 2 | ||||
-rw-r--r-- | tap-snapshots/test/lib/utils/npm-usage.js.test.cjs | 2 |
3 files changed, 6 insertions, 0 deletions
diff --git a/lib/commands/pkg.js b/lib/commands/pkg.js index 007932429..6ca892293 100644 --- a/lib/commands/pkg.js +++ b/lib/commands/pkg.js @@ -9,6 +9,8 @@ class Pkg extends BaseCommand { 'set <key>=<value> [<key>=<value> ...]', 'get [<key> [<key> ...]]', 'delete <key> [<key> ...]', + 'set [<array>[<index>].<key>=<value> ...]', + 'set [<array>[].<key>=<value> ...]', ] static params = [ diff --git a/tap-snapshots/test/lib/load-all-commands.js.test.cjs b/tap-snapshots/test/lib/load-all-commands.js.test.cjs index c9da1e236..d84cdfb30 100644 --- a/tap-snapshots/test/lib/load-all-commands.js.test.cjs +++ b/tap-snapshots/test/lib/load-all-commands.js.test.cjs @@ -690,6 +690,8 @@ Usage: npm pkg set <key>=<value> [<key>=<value> ...] npm pkg get [<key> [<key> ...]] npm pkg delete <key> [<key> ...] +npm pkg set [<array>[<index>].<key>=<value> ...] +npm pkg set [<array>[].<key>=<value> ...] Options: [-f|--force] [--json] diff --git a/tap-snapshots/test/lib/utils/npm-usage.js.test.cjs b/tap-snapshots/test/lib/utils/npm-usage.js.test.cjs index f91f2b11d..42c24fabd 100644 --- a/tap-snapshots/test/lib/utils/npm-usage.js.test.cjs +++ b/tap-snapshots/test/lib/utils/npm-usage.js.test.cjs @@ -773,6 +773,8 @@ All commands: npm pkg set <key>=<value> [<key>=<value> ...] npm pkg get [<key> [<key> ...]] npm pkg delete <key> [<key> ...] + npm pkg set [<array>[<index>].<key>=<value> ...] + npm pkg set [<array>[].<key>=<value> ...] Options: [-f|--force] [--json] |