From 8a46780d3f7b1d34a6d22e72e058e5693b0d3baf Mon Sep 17 00:00:00 2001 From: Eric Doughty-Papassideris Date: Tue, 26 Mar 2024 12:06:22 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20=E2=9C=A8=20Add=20completion=20a?= =?UTF-8?q?nd=20handling=20of=20decorated=20imports=20(#438)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tdrive/backend/node/README.md | 16 +++++++++++----- tdrive/backend/node/src/cli/index.ts | 2 ++ 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/tdrive/backend/node/README.md b/tdrive/backend/node/README.md index da3f8c8c..a6c8b818 100644 --- a/tdrive/backend/node/README.md +++ b/tdrive/backend/node/README.md @@ -41,7 +41,7 @@ will run unit tests only (`test:unit`). For possible tests to run, check the `pa The Twake backend CLI The Twake backend CLI provides a set of commands to manage/use/develop Tdrive from the `twake-cli` executable. -Before using the CLI, you must `compile` Tdrive with `npm run build`. Once done, you can get help on on any command with the `--help` flag like `./bin/twake-cli --help`. +Before using the CLI, you must `compile` Tdrive with `npm run build`. Once done, you can get help on on any command with the `--help` flag like `bin/twake-cli --help`. It uses the same configuration as the Tdrive backend application. Including environment variables and the `./config/default.json` file. @@ -50,9 +50,6 @@ It uses the same configuration as the Tdrive backend application. Including envi This command re-indexes entities of the given repository from the database to the search service. ```sh -<<<<<<< HEAD -./bin/twake-cli search index --repository users --repairEntities -======= bin/twake-cli search index --repository users --repairEntities ``` @@ -66,7 +63,16 @@ choices (or we're using it wrong). ```sh eval "$(bin/twake-cli completion)" ->>>>>>> c95ca33f (fixup! 📝 Updating README.md with CLI example (#438)) +``` + +#### Bash completion + +It's a bit awkward to do real completion from a configuration since this isn't really a node module we recommend to install globally. +This should setup a shell if you're in the right path however. It's yarg's auto generated completion though; so eg: it mixes up commands and +choices (or we're using it wrong). + +```sh +eval "$(bin/twake-cli completion)" ``` ### Component Framework diff --git a/tdrive/backend/node/src/cli/index.ts b/tdrive/backend/node/src/cli/index.ts index 848b708b..ebff7056 100644 --- a/tdrive/backend/node/src/cli/index.ts +++ b/tdrive/backend/node/src/cli/index.ts @@ -1,3 +1,4 @@ +import "reflect-metadata"; import yargs from "yargs"; import { logger } from "../core/platform/framework/logger"; @@ -24,5 +25,6 @@ yargs .alias("help", "h") .help("help") .version() + .completion("completion") .epilogue("for more information, go to https://tdrive.app") .example("$0 --help", "show help of the issue command").argv;