diff --git a/Cargo.lock b/Cargo.lock index c40f1910..e7c7fb48 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1043,7 +1043,6 @@ dependencies = [ "bpaf", "pglt_analyse", "pglt_analyser", - "pglt_cli", "pglt_configuration", "pglt_console", "pglt_diagnostics", @@ -1051,6 +1050,7 @@ dependencies = [ "pglt_query_ext", "pglt_statement_splitter", "pglt_workspace", + "pgt_cli", "pulldown-cmark", "regex", "schemars", @@ -2338,42 +2338,6 @@ dependencies = [ "termcolor", ] -[[package]] -name = "pglt_cli" -version = "0.0.0" -dependencies = [ - "anyhow", - "biome_deserialize 0.6.0", - "biome_deserialize_macros 0.6.0", - "bpaf", - "crossbeam", - "dashmap 5.5.3", - "hdrhistogram", - "libc", - "mimalloc", - "path-absolutize", - "pglt_analyse", - "pglt_configuration", - "pglt_console", - "pglt_diagnostics", - "pglt_flags", - "pglt_fs", - "pglt_lsp", - "pglt_text_edit", - "pglt_workspace", - "quick-junit", - "rayon", - "rustc-hash 2.1.0", - "serde", - "serde_json", - "tikv-jemallocator", - "tokio", - "tracing", - "tracing-appender", - "tracing-subscriber", - "tracing-tree", -] - [[package]] name = "pglt_commands" version = "0.0.0" @@ -2736,6 +2700,42 @@ dependencies = [ "tree_sitter_sql", ] +[[package]] +name = "pgt_cli" +version = "0.0.0" +dependencies = [ + "anyhow", + "biome_deserialize 0.6.0", + "biome_deserialize_macros 0.6.0", + "bpaf", + "crossbeam", + "dashmap 5.5.3", + "hdrhistogram", + "libc", + "mimalloc", + "path-absolutize", + "pglt_analyse", + "pglt_configuration", + "pglt_console", + "pglt_diagnostics", + "pglt_flags", + "pglt_fs", + "pglt_lsp", + "pglt_text_edit", + "pglt_workspace", + "quick-junit", + "rayon", + "rustc-hash 2.1.0", + "serde", + "serde_json", + "tikv-jemallocator", + "tokio", + "tracing", + "tracing-appender", + "tracing-subscriber", + "tracing-tree", +] + [[package]] name = "pin-project" version = "1.1.7" diff --git a/Cargo.toml b/Cargo.toml index 3f7fbffa..42fffe71 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -54,7 +54,6 @@ unicode-width = "0.1.12" pglt_analyse = { path = "./crates/pglt_analyse", version = "0.0.0" } pglt_analyser = { path = "./crates/pglt_analyser", version = "0.0.0" } pglt_base_db = { path = "./crates/pglt_base_db", version = "0.0.0" } -pglt_cli = { path = "./crates/pglt_cli", version = "0.0.0" } pglt_commands = { path = "./crates/pglt_commands", version = "0.0.0" } pglt_completions = { path = "./crates/pglt_completions", version = "0.0.0" } pglt_configuration = { path = "./crates/pglt_configuration", version = "0.0.0" } @@ -81,6 +80,7 @@ pglt_treesitter_queries = { path = "./crates/pglt_treesitter_queries", versi pglt_type_resolver = { path = "./crates/pglt_type_resolver", version = "0.0.0" } pglt_typecheck = { path = "./crates/pglt_typecheck", version = "0.0.0" } pglt_workspace = { path = "./crates/pglt_workspace", version = "0.0.0" } +pgt_cli = { path = "./crates/pgt_cli", version = "0.0.0" } pglt_test_macros = { path = "./crates/pglt_test_macros" } pglt_test_utils = { path = "./crates/pglt_test_utils" } diff --git a/crates/pglt_cli/Cargo.toml b/crates/pgt_cli/Cargo.toml similarity index 97% rename from crates/pglt_cli/Cargo.toml rename to crates/pgt_cli/Cargo.toml index 204d2091..7c6e6779 100644 --- a/crates/pglt_cli/Cargo.toml +++ b/crates/pgt_cli/Cargo.toml @@ -6,7 +6,7 @@ edition.workspace = true homepage.workspace = true keywords.workspace = true license.workspace = true -name = "pglt_cli" +name = "pgt_cli" repository.workspace = true version = "0.0.0" @@ -56,5 +56,5 @@ tikv-jemallocator = "0.6.0" doctest = false [[bin]] -name = "pglt" +name = "postgrestools" path = "src/main.rs" diff --git a/crates/pglt_cli/src/changed.rs b/crates/pgt_cli/src/changed.rs similarity index 100% rename from crates/pglt_cli/src/changed.rs rename to crates/pgt_cli/src/changed.rs diff --git a/crates/pglt_cli/src/cli_options.rs b/crates/pgt_cli/src/cli_options.rs similarity index 100% rename from crates/pglt_cli/src/cli_options.rs rename to crates/pgt_cli/src/cli_options.rs diff --git a/crates/pglt_cli/src/commands/check.rs b/crates/pgt_cli/src/commands/check.rs similarity index 100% rename from crates/pglt_cli/src/commands/check.rs rename to crates/pgt_cli/src/commands/check.rs diff --git a/crates/pglt_cli/src/commands/clean.rs b/crates/pgt_cli/src/commands/clean.rs similarity index 100% rename from crates/pglt_cli/src/commands/clean.rs rename to crates/pgt_cli/src/commands/clean.rs diff --git a/crates/pglt_cli/src/commands/daemon.rs b/crates/pgt_cli/src/commands/daemon.rs similarity index 100% rename from crates/pglt_cli/src/commands/daemon.rs rename to crates/pgt_cli/src/commands/daemon.rs diff --git a/crates/pglt_cli/src/commands/init.rs b/crates/pgt_cli/src/commands/init.rs similarity index 100% rename from crates/pglt_cli/src/commands/init.rs rename to crates/pgt_cli/src/commands/init.rs diff --git a/crates/pglt_cli/src/commands/mod.rs b/crates/pgt_cli/src/commands/mod.rs similarity index 99% rename from crates/pglt_cli/src/commands/mod.rs rename to crates/pgt_cli/src/commands/mod.rs index 16b7b976..2799fc3b 100644 --- a/crates/pglt_cli/src/commands/mod.rs +++ b/crates/pgt_cli/src/commands/mod.rs @@ -43,7 +43,7 @@ pub enum PgltCommand { /// /// The file doesn't need to exist on disk, what matters is the extension of the file. Based on the extension, we know how to check the code. /// - /// Example: `echo 'let a;' | pglt_cli check --stdin-file-path=test.sql` + /// Example: `echo 'let a;' | pgt_cli check --stdin-file-path=test.sql` #[bpaf(long("stdin-file-path"), argument("PATH"), hide_usage)] stdin_file_path: Option, diff --git a/crates/pglt_cli/src/commands/version.rs b/crates/pgt_cli/src/commands/version.rs similarity index 100% rename from crates/pglt_cli/src/commands/version.rs rename to crates/pgt_cli/src/commands/version.rs diff --git a/crates/pglt_cli/src/diagnostics.rs b/crates/pgt_cli/src/diagnostics.rs similarity index 100% rename from crates/pglt_cli/src/diagnostics.rs rename to crates/pgt_cli/src/diagnostics.rs diff --git a/crates/pglt_cli/src/execute/diagnostics.rs b/crates/pgt_cli/src/execute/diagnostics.rs similarity index 100% rename from crates/pglt_cli/src/execute/diagnostics.rs rename to crates/pgt_cli/src/execute/diagnostics.rs diff --git a/crates/pglt_cli/src/execute/mod.rs b/crates/pgt_cli/src/execute/mod.rs similarity index 100% rename from crates/pglt_cli/src/execute/mod.rs rename to crates/pgt_cli/src/execute/mod.rs diff --git a/crates/pglt_cli/src/execute/process_file.rs b/crates/pgt_cli/src/execute/process_file.rs similarity index 100% rename from crates/pglt_cli/src/execute/process_file.rs rename to crates/pgt_cli/src/execute/process_file.rs diff --git a/crates/pglt_cli/src/execute/process_file/check.rs b/crates/pgt_cli/src/execute/process_file/check.rs similarity index 100% rename from crates/pglt_cli/src/execute/process_file/check.rs rename to crates/pgt_cli/src/execute/process_file/check.rs diff --git a/crates/pglt_cli/src/execute/process_file/workspace_file.rs b/crates/pgt_cli/src/execute/process_file/workspace_file.rs similarity index 100% rename from crates/pglt_cli/src/execute/process_file/workspace_file.rs rename to crates/pgt_cli/src/execute/process_file/workspace_file.rs diff --git a/crates/pglt_cli/src/execute/std_in.rs b/crates/pgt_cli/src/execute/std_in.rs similarity index 100% rename from crates/pglt_cli/src/execute/std_in.rs rename to crates/pgt_cli/src/execute/std_in.rs diff --git a/crates/pglt_cli/src/execute/traverse.rs b/crates/pgt_cli/src/execute/traverse.rs similarity index 100% rename from crates/pglt_cli/src/execute/traverse.rs rename to crates/pgt_cli/src/execute/traverse.rs diff --git a/crates/pglt_cli/src/lib.rs b/crates/pgt_cli/src/lib.rs similarity index 100% rename from crates/pglt_cli/src/lib.rs rename to crates/pgt_cli/src/lib.rs diff --git a/crates/pglt_cli/src/logging.rs b/crates/pgt_cli/src/logging.rs similarity index 100% rename from crates/pglt_cli/src/logging.rs rename to crates/pgt_cli/src/logging.rs diff --git a/crates/pglt_cli/src/main.rs b/crates/pgt_cli/src/main.rs similarity index 99% rename from crates/pglt_cli/src/main.rs rename to crates/pgt_cli/src/main.rs index c79f5ab0..dcdc1096 100644 --- a/crates/pglt_cli/src/main.rs +++ b/crates/pgt_cli/src/main.rs @@ -1,12 +1,12 @@ //! This is the main binary -use pglt_cli::{ - CliDiagnostic, CliSession, PgltCommand, open_transport, pglt_command, setup_panic_handler, - to_color_mode, -}; use pglt_console::{ConsoleExt, EnvConsole, markup}; use pglt_diagnostics::{Diagnostic, PrintDiagnostic, set_bottom_frame}; use pglt_workspace::workspace; +use pgt_cli::{ + CliDiagnostic, CliSession, PgltCommand, open_transport, pglt_command, setup_panic_handler, + to_color_mode, +}; use std::process::{ExitCode, Termination}; use tokio::runtime::Runtime; diff --git a/crates/pglt_cli/src/metrics.rs b/crates/pgt_cli/src/metrics.rs similarity index 100% rename from crates/pglt_cli/src/metrics.rs rename to crates/pgt_cli/src/metrics.rs diff --git a/crates/pglt_cli/src/panic.rs b/crates/pgt_cli/src/panic.rs similarity index 100% rename from crates/pglt_cli/src/panic.rs rename to crates/pgt_cli/src/panic.rs diff --git a/crates/pglt_cli/src/reporter/github.rs b/crates/pgt_cli/src/reporter/github.rs similarity index 100% rename from crates/pglt_cli/src/reporter/github.rs rename to crates/pgt_cli/src/reporter/github.rs diff --git a/crates/pglt_cli/src/reporter/gitlab.rs b/crates/pgt_cli/src/reporter/gitlab.rs similarity index 100% rename from crates/pglt_cli/src/reporter/gitlab.rs rename to crates/pgt_cli/src/reporter/gitlab.rs diff --git a/crates/pglt_cli/src/reporter/junit.rs b/crates/pgt_cli/src/reporter/junit.rs similarity index 100% rename from crates/pglt_cli/src/reporter/junit.rs rename to crates/pgt_cli/src/reporter/junit.rs diff --git a/crates/pglt_cli/src/reporter/mod.rs b/crates/pgt_cli/src/reporter/mod.rs similarity index 100% rename from crates/pglt_cli/src/reporter/mod.rs rename to crates/pgt_cli/src/reporter/mod.rs diff --git a/crates/pglt_cli/src/reporter/terminal.rs b/crates/pgt_cli/src/reporter/terminal.rs similarity index 100% rename from crates/pglt_cli/src/reporter/terminal.rs rename to crates/pgt_cli/src/reporter/terminal.rs diff --git a/crates/pglt_cli/src/service/mod.rs b/crates/pgt_cli/src/service/mod.rs similarity index 100% rename from crates/pglt_cli/src/service/mod.rs rename to crates/pgt_cli/src/service/mod.rs diff --git a/crates/pglt_cli/src/service/unix.rs b/crates/pgt_cli/src/service/unix.rs similarity index 100% rename from crates/pglt_cli/src/service/unix.rs rename to crates/pgt_cli/src/service/unix.rs diff --git a/crates/pglt_cli/src/service/windows.rs b/crates/pgt_cli/src/service/windows.rs similarity index 100% rename from crates/pglt_cli/src/service/windows.rs rename to crates/pgt_cli/src/service/windows.rs diff --git a/docs/cli_reference.md b/docs/cli_reference.md index 919b0d3e..8779372a 100644 --- a/docs/cli_reference.md +++ b/docs/cli_reference.md @@ -1,289 +1,270 @@ ## CLI Reference -[//]: # (BEGIN CLI_REF) - - +[//]: # "BEGIN CLI_REF" # Command summary - * [`pglt`↴](#pglt) - * [`pglt version`↴](#pglt-version) - * [`pglt check`↴](#pglt-check) - * [`pglt start`↴](#pglt-start) - * [`pglt stop`↴](#pglt-stop) - * [`pglt init`↴](#pglt-init) - * [`pglt lsp-proxy`↴](#pglt-lsp-proxy) - * [`pglt clean`↴](#pglt-clean) +- [`postgrestools`↴](#postgrestools) +- [`postgrestools version`↴](#postgrestools-version) +- [`postgrestools check`↴](#postgrestools-check) +- [`postgrestools start`↴](#postgrestools-start) +- [`postgrestools stop`↴](#postgrestools-stop) +- [`postgrestools init`↴](#postgrestools-init) +- [`postgrestools lsp-proxy`↴](#postgrestools-lsp-proxy) +- [`postgrestools clean`↴](#postgrestools-clean) -## pglt +## postgrestools -PgLT official CLI. Use it to check the health of your project or run it to check single files. +PostgresTools official CLI. Use it to check the health of your project or run it to check single files. -**Usage**: **`pglt`** _`COMMAND ...`_ +**Usage**: **`postgrestools`** _`COMMAND ...`_ **Available options:** -- **`-h`**, **`--help`** — + +- **`-h`**, **`--help`** — Prints help information -- **`-V`**, **`--version`** — +- **`-V`**, **`--version`** — Prints version information - - **Available commands:** -- **`version`** — + +- **`version`** — Shows the version information and quit. -- **`check`** — +- **`check`** — Runs everything to the requested files. -- **`start`** — +- **`start`** — Starts the daemon server process. -- **`stop`** — +- **`stop`** — Stops the daemon server process. -- **`init`** — +- **`init`** — Bootstraps a new project. Creates a configuration file with some defaults. -- **`lsp-proxy`** — +- **`lsp-proxy`** — Acts as a server for the Language Server Protocol over stdin/stdout. -- **`clean`** — +- **`clean`** — Cleans the logs emitted by the daemon. - -## pglt version +## postgrestools version Shows the version information and quit. -**Usage**: **`pglt`** **`version`** +**Usage**: **`postgrestools`** **`version`** **Global options applied to all commands** -- **` --colors`**=_``_ — + +- **` --colors`**=_``_ — Set the formatting mode for markup: "off" prints everything as plain text, "force" forces the formatting of markup using ANSI even if the console output is determined to be incompatible -- **` --use-server`** — +- **` --use-server`** — Connect to a running instance of the daemon server. -- **` --skip-db`** — +- **` --skip-db`** — Skip connecting to the database and only run checks that don't require a database connection. -- **` --verbose`** — +- **` --verbose`** — Print additional diagnostics, and some diagnostics show more information. Also, print out what files were processed and which ones were modified. -- **` --config-path`**=_`PATH`_ — - Set the file path to the configuration file, or the directory path to find `pglt.jsonc`. If used, it disables the default configuration file resolution. -- **` --max-diagnostics`**=_`>`_ — +- **` --config-path`**=_`PATH`_ — + Set the file path to the configuration file, or the directory path to find `postgrestools.jsonc`. If used, it disables the default configuration file resolution. +- **` --max-diagnostics`**=_`>`_ — Cap the amount of diagnostics displayed. When `none` is provided, the limit is lifted. - [default: 20] -- **` --skip-errors`** — +- **` --skip-errors`** — Skip over files containing syntax errors instead of emitting an error diagnostic. -- **` --no-errors-on-unmatched`** — +- **` --no-errors-on-unmatched`** — Silence errors that would be emitted in case no files were processed during the execution of the command. -- **` --error-on-warnings`** — +- **` --error-on-warnings`** — Tell PgLT to exit with an error code if some diagnostics emit warnings. -- **` --reporter`**=_``_ — +- **` --reporter`**=_``_ — Allows to change how diagnostics and summary are reported. -- **` --log-level`**=_``_ — +- **` --log-level`**=_``_ — The level of logging. In order, from the most verbose to the least verbose: debug, info, warn, error. The value `none` won't show any logging. - + [default: none] -- **` --log-kind`**=_``_ — + +- **` --log-kind`**=_``_ — How the log should look like. - [default: pretty] -- **` --diagnostic-level`**=_``_ — +- **` --diagnostic-level`**=_``_ — The level of diagnostics to show. In order, from the lowest to the most important: info, warn, error. Passing `--diagnostic-level=error` will cause PgLT to print only diagnostics that contain only errors. - [default: info] - - **Available options:** -- **`-h`**, **`--help`** — - Prints help information +- **`-h`**, **`--help`** — + Prints help information -## pglt check +## postgrestools check Runs everything to the requested files. -**Usage**: **`pglt`** **`check`** \[**`--staged`**\] \[**`--changed`**\] \[**`--since`**=_`REF`_\] \[_`PATH`_\]... +**Usage**: **`postgrestools`** **`check`** \[**`--staged`**\] \[**`--changed`**\] \[**`--since`**=_`REF`_\] \[_`PATH`_\]... **The configuration that is contained inside the configuration file.** -- **` --vcs-enabled`**=_``_ — + +- **` --vcs-enabled`**=_``_ — Whether we should integrate itself with the VCS client -- **` --vcs-client-kind`**=_``_ — +- **` --vcs-client-kind`**=_``_ — The kind of client. -- **` --vcs-use-ignore-file`**=_``_ — +- **` --vcs-use-ignore-file`**=_``_ — Whether we should use the VCS ignore file. When [true], we will ignore the files specified in the ignore file. -- **` --vcs-root`**=_`PATH`_ — - The folder where we should check for VCS files. By default, we will use the same folder where `pglt.jsonc` was found. +- **` --vcs-root`**=_`PATH`_ — + The folder where we should check for VCS files. By default, we will use the same folder where `postgrestools.jsonc` was found. If we can't find the configuration, it will attempt to use the current working directory. If no current working directory can't be found, we won't use the VCS integration, and a diagnostic will be emitted -- **` --vcs-default-branch`**=_`BRANCH`_ — + +- **` --vcs-default-branch`**=_`BRANCH`_ — The main branch of the project -- **` --files-max-size`**=_`NUMBER`_ — +- **` --files-max-size`**=_`NUMBER`_ — The maximum allowed size for source code files in bytes. Files above this limit will be ignored for performance reasons. Defaults to 1 MiB -- **` --migrations-dir`**=_`ARG`_ — +- **` --migrations-dir`**=_`ARG`_ — The directory where the migration files are stored -- **` --after`**=_`ARG`_ — +- **` --after`**=_`ARG`_ — Ignore any migrations before this timestamp -- **` --host`**=_`ARG`_ — +- **` --host`**=_`ARG`_ — The host of the database. -- **` --port`**=_`ARG`_ — +- **` --port`**=_`ARG`_ — The port of the database. -- **` --username`**=_`ARG`_ — +- **` --username`**=_`ARG`_ — The username to connect to the database. -- **` --password`**=_`ARG`_ — +- **` --password`**=_`ARG`_ — The password to connect to the database. -- **` --database`**=_`ARG`_ — +- **` --database`**=_`ARG`_ — The name of the database. -- **` --conn_timeout_secs`**=_`ARG`_ — +- **` --conn_timeout_secs`**=_`ARG`_ — The connection timeout in seconds. - [default: Some(10)] - - **Global options applied to all commands** -- **` --colors`**=_``_ — + +- **` --colors`**=_``_ — Set the formatting mode for markup: "off" prints everything as plain text, "force" forces the formatting of markup using ANSI even if the console output is determined to be incompatible -- **` --use-server`** — +- **` --use-server`** — Connect to a running instance of the daemon server. -- **` --skip-db`** — +- **` --skip-db`** — Skip connecting to the database and only run checks that don't require a database connection. -- **` --verbose`** — +- **` --verbose`** — Print additional diagnostics, and some diagnostics show more information. Also, print out what files were processed and which ones were modified. -- **` --config-path`**=_`PATH`_ — - Set the file path to the configuration file, or the directory path to find `pglt.jsonc`. If used, it disables the default configuration file resolution. -- **` --max-diagnostics`**=_`>`_ — +- **` --config-path`**=_`PATH`_ — + Set the file path to the configuration file, or the directory path to find `postgrestools.jsonc`. If used, it disables the default configuration file resolution. +- **` --max-diagnostics`**=_`>`_ — Cap the amount of diagnostics displayed. When `none` is provided, the limit is lifted. - [default: 20] -- **` --skip-errors`** — +- **` --skip-errors`** — Skip over files containing syntax errors instead of emitting an error diagnostic. -- **` --no-errors-on-unmatched`** — +- **` --no-errors-on-unmatched`** — Silence errors that would be emitted in case no files were processed during the execution of the command. -- **` --error-on-warnings`** — +- **` --error-on-warnings`** — Tell PgLT to exit with an error code if some diagnostics emit warnings. -- **` --reporter`**=_``_ — +- **` --reporter`**=_``_ — Allows to change how diagnostics and summary are reported. -- **` --log-level`**=_``_ — +- **` --log-level`**=_``_ — The level of logging. In order, from the most verbose to the least verbose: debug, info, warn, error. The value `none` won't show any logging. - + [default: none] -- **` --log-kind`**=_``_ — + +- **` --log-kind`**=_``_ — How the log should look like. - [default: pretty] -- **` --diagnostic-level`**=_``_ — +- **` --diagnostic-level`**=_``_ — The level of diagnostics to show. In order, from the lowest to the most important: info, warn, error. Passing `--diagnostic-level=error` will cause PgLT to print only diagnostics that contain only errors. - [default: info] - - **Available positional items:** -- _`PATH`_ — - Single file, single path or list of paths - +- _`PATH`_ — + Single file, single path or list of paths **Available options:** -- **` --stdin-file-path`**=_`PATH`_ — + +- **` --stdin-file-path`**=_`PATH`_ — Use this option when you want to format code piped from `stdin`, and print the output to `stdout`. The file doesn't need to exist on disk, what matters is the extension of the file. Based on the extension, we know how to check the code. - Example: `echo 'let a;' | pglt_cli check --stdin-file-path=test.sql` -- **` --staged`** — + Example: `echo 'let a;' | pgt_cli check --stdin-file-path=test.sql` + +- **` --staged`** — When set to true, only the files that have been staged (the ones prepared to be committed) will be linted. This option should be used when working locally. -- **` --changed`** — +- **` --changed`** — When set to true, only the files that have been changed compared to your `defaultBranch` configuration will be linted. This option should be used in CI environments. -- **` --since`**=_`REF`_ — - Use this to specify the base branch to compare against when you're using the --changed flag and the `defaultBranch` is not set in your `pglt.jsonc` -- **`-h`**, **`--help`** — +- **` --since`**=_`REF`_ — + Use this to specify the base branch to compare against when you're using the --changed flag and the `defaultBranch` is not set in your `postgrestools.jsonc` +- **`-h`**, **`--help`** — Prints help information - -## pglt start +## postgrestools start Starts the daemon server process. -**Usage**: **`pglt`** **`start`** \[**`--config-path`**=_`PATH`_\] +**Usage**: **`postgrestools`** **`start`** \[**`--config-path`**=_`PATH`_\] **Available options:** -- **` --log-prefix-name`**=_`STRING`_ — + +- **` --log-prefix-name`**=_`STRING`_ — Allows to change the prefix applied to the file name of the logs. - Uses environment variable **`PGLT_LOG_PREFIX_NAME`** - [default: server.log] -- **` --log-path`**=_`PATH`_ — +- **` --log-path`**=_`PATH`_ — Allows to change the folder where logs are stored. - Uses environment variable **`PGLT_LOG_PATH`** -- **` --config-path`**=_`PATH`_ — - Allows to set a custom file path to the configuration file, or a custom directory path to find `pglt.jsonc` - +- **` --config-path`**=_`PATH`_ — + Allows to set a custom file path to the configuration file, or a custom directory path to find `postgrestools.jsonc` Uses environment variable **`PGLT_LOG_PREFIX_NAME`** -- **`-h`**, **`--help`** — +- **`-h`**, **`--help`** — Prints help information - -## pglt stop +## postgrestools stop Stops the daemon server process. -**Usage**: **`pglt`** **`stop`** +**Usage**: **`postgrestools`** **`stop`** **Available options:** -- **`-h`**, **`--help`** — - Prints help information +- **`-h`**, **`--help`** — + Prints help information -## pglt init +## postgrestools init Bootstraps a new project. Creates a configuration file with some defaults. -**Usage**: **`pglt`** **`init`** +**Usage**: **`postgrestools`** **`init`** **Available options:** -- **`-h`**, **`--help`** — - Prints help information +- **`-h`**, **`--help`** — + Prints help information -## pglt lsp-proxy +## postgrestools lsp-proxy Acts as a server for the Language Server Protocol over stdin/stdout. -**Usage**: **`pglt`** **`lsp-proxy`** \[**`--config-path`**=_`PATH`_\] +**Usage**: **`postgrestools`** **`lsp-proxy`** \[**`--config-path`**=_`PATH`_\] **Available options:** -- **` --log-prefix-name`**=_`STRING`_ — + +- **` --log-prefix-name`**=_`STRING`_ — Allows to change the prefix applied to the file name of the logs. - Uses environment variable **`PGLT_LOG_PREFIX_NAME`** - [default: server.log] -- **` --log-path`**=_`PATH`_ — +- **` --log-path`**=_`PATH`_ — Allows to change the folder where logs are stored. - Uses environment variable **`PGLT_LOG_PATH`** -- **` --config-path`**=_`PATH`_ — - Allows to set a custom file path to the configuration file, or a custom directory path to find `pglt.jsonc` - +- **` --config-path`**=_`PATH`_ — + Allows to set a custom file path to the configuration file, or a custom directory path to find `postgrestools.jsonc` Uses environment variable **`PGLT_CONFIG_PATH`** -- **`-h`**, **`--help`** — +- **`-h`**, **`--help`** — Prints help information - -## pglt clean +## postgrestools clean Cleans the logs emitted by the daemon. -**Usage**: **`pglt`** **`clean`** +**Usage**: **`postgrestools`** **`clean`** **Available options:** -- **`-h`**, **`--help`** — - Prints help information - +- **`-h`**, **`--help`** — + Prints help information -[//]: # (END CLI_REF) +[//]: # "END CLI_REF" diff --git a/docs/codegen/Cargo.toml b/docs/codegen/Cargo.toml index ba1bc52f..948574c5 100644 --- a/docs/codegen/Cargo.toml +++ b/docs/codegen/Cargo.toml @@ -22,7 +22,7 @@ pulldown-cmark = "0.12.2" pglt_configuration = { workspace = true, features = ["schema"] } pglt_flags = { workspace = true } -pglt_cli = { workspace = true } +pgt_cli = { workspace = true } pglt_analyse = { workspace = true } pglt_analyser = { workspace = true } pglt_diagnostics = { workspace = true } diff --git a/docs/codegen/src/cli_doc.rs b/docs/codegen/src/cli_doc.rs index ad299605..cbde1028 100644 --- a/docs/codegen/src/cli_doc.rs +++ b/docs/codegen/src/cli_doc.rs @@ -1,4 +1,4 @@ -use pglt_cli::pglt_command; +use pgt_cli::pglt_command; use std::{fs, path::Path}; use crate::utils; diff --git a/packages/@postgrestools/backend-jsonrpc/src/workspace.ts b/packages/@postgrestools/backend-jsonrpc/src/workspace.ts index e71d9457..d7892f46 100644 --- a/packages/@postgrestools/backend-jsonrpc/src/workspace.ts +++ b/packages/@postgrestools/backend-jsonrpc/src/workspace.ts @@ -423,28 +423,28 @@ export interface Workspace { export function createWorkspace(transport: Transport): Workspace { return { isPathIgnored(params) { - return transport.request("pgt/is_path_ignored", params); + return transport.request("pglt/is_path_ignored", params); }, getFileContent(params) { - return transport.request("pgt/get_file_content", params); + return transport.request("pglt/get_file_content", params); }, pullDiagnostics(params) { - return transport.request("pgt/pull_diagnostics", params); + return transport.request("pglt/pull_diagnostics", params); }, getCompletions(params) { - return transport.request("pgt/get_completions", params); + return transport.request("pglt/get_completions", params); }, updateSettings(params) { - return transport.request("pgt/update_settings", params); + return transport.request("pglt/update_settings", params); }, openFile(params) { - return transport.request("pgt/open_file", params); + return transport.request("pglt/open_file", params); }, changeFile(params) { - return transport.request("pgt/change_file", params); + return transport.request("pglt/change_file", params); }, closeFile(params) { - return transport.request("pgt/close_file", params); + return transport.request("pglt/close_file", params); }, destroy() { transport.destroy(); diff --git a/xtask/src/install.rs b/xtask/src/install.rs index 22717008..faaf5c56 100644 --- a/xtask/src/install.rs +++ b/xtask/src/install.rs @@ -137,7 +137,7 @@ fn install_client(sh: &Shell, client_opt: ClientOpt) -> anyhow::Result<()> { } fn install_server(sh: &Shell) -> anyhow::Result<()> { - let cmd = cmd!(sh, "cargo install --path crates/pglt_cli --locked --force"); + let cmd = cmd!(sh, "cargo install --path crates/pgt_cli --locked --force"); cmd.run()?; Ok(()) }