diff --git a/src/main/java/com/crowdin/cli/commands/picocli/CompletionSubCommand.java b/src/main/java/com/crowdin/cli/commands/picocli/CompletionSubCommand.java new file mode 100644 index 00000000..537c1c98 --- /dev/null +++ b/src/main/java/com/crowdin/cli/commands/picocli/CompletionSubCommand.java @@ -0,0 +1,8 @@ +package com.crowdin.cli.commands.picocli; + +import picocli.AutoComplete; +import picocli.CommandLine; + +@CommandLine.Command(name = "completion", hidden = true) +class CompletionSubCommand extends AutoComplete.GenerateCompletion { +} diff --git a/src/main/java/com/crowdin/cli/commands/picocli/RootCommand.java b/src/main/java/com/crowdin/cli/commands/picocli/RootCommand.java index ff475925..d64b1aab 100644 --- a/src/main/java/com/crowdin/cli/commands/picocli/RootCommand.java +++ b/src/main/java/com/crowdin/cli/commands/picocli/RootCommand.java @@ -24,7 +24,8 @@ FileSubcommand.class, LanguageSubcommand.class, ConfigSubcommand.class, - ProjectSubcommand.class + ProjectSubcommand.class, + CompletionSubCommand.class }) class RootCommand extends HelpCommand { @Override diff --git a/website/docs/intro.md b/website/docs/intro.md index 97e7e951..657e6d73 100644 --- a/website/docs/intro.md +++ b/website/docs/intro.md @@ -107,6 +107,12 @@ For [DEB](/installation#debian), [RPM](/installation#rpm), and [ArchLinux](/inst ::: +However, Crowdin CLI also comes with built-in subcommand to generate completion script for you: + +```bash +crowdin completion +``` + ## Requirements Check that you have Java 8 or newer installed. Type `java -version` command in the terminal (Command Prompt on Windows) to check Java version. For example, java version "1.8.0_212" means that you have Java 8 Update 212 installed.