-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move completions install / uninstall options to their own file
- Loading branch information
1 parent
d847292
commit 49c6aab
Showing
3 changed files
with
64 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
core/shared/src/main/scala/caseapp/core/complete/CompletionsInstallOptions.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package caseapp.core.complete | ||
|
||
import caseapp.{HelpMessage, Name} | ||
import caseapp.core.help.Help | ||
import caseapp.core.parser.Parser | ||
|
||
// from https://github.com/VirtusLab/scala-cli/blob/eced0b35c769eca58ae6f1b1a3be0f29a8700859/modules/cli/src/main/scala/scala/cli/commands/installcompletions/InstallCompletionsOptions.scala | ||
// format: off | ||
final case class CompletionsInstallOptions( | ||
@HelpMessage("Print completions to stdout") | ||
env: Boolean = false, | ||
@HelpMessage("Custom completions name") | ||
name: Option[String] = None, | ||
@HelpMessage("Name of the shell, either zsh, fish or bash") | ||
@Name("shell") | ||
format: Option[String] = None, | ||
@HelpMessage("Completions output directory (defaults to $XDG_CONFIG_HOME/fish/completions on fish)") | ||
@Name("o") | ||
output: Option[String] = None, | ||
@HelpMessage("Custom banner in comment placed in rc file (bash or zsh only)") | ||
banner: String = "{NAME} completions", | ||
@HelpMessage("Path to `*rc` file, defaults to `.bashrc` or `.zshrc` depending on shell (bash or zsh only)") | ||
rcFile: Option[String] = None | ||
) | ||
// format: on | ||
|
||
object CompletionsInstallOptions { | ||
implicit lazy val parser: Parser[CompletionsInstallOptions] = Parser.derive | ||
implicit lazy val help: Help[CompletionsInstallOptions] = Help.derive | ||
} |
25 changes: 25 additions & 0 deletions
25
core/shared/src/main/scala/caseapp/core/complete/CompletionsUninstallOptions.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package caseapp.core.complete | ||
|
||
import caseapp.{HelpMessage, Name} | ||
import caseapp.core.help.Help | ||
import caseapp.core.parser.Parser | ||
|
||
// from https://github.com/VirtusLab/scala-cli/blob/eced0b35c769eca58ae6f1b1a3be0f29a8700859/modules/cli/src/main/scala/scala/cli/commands/uninstallcompletions/SharedUninstallCompletionsOptions.scala | ||
// format: off | ||
final case class CompletionsUninstallOptions( | ||
@HelpMessage("Path to `*rc` file, defaults to `.bashrc` or `.zshrc` depending on shell (bash or zsh only)") | ||
rcFile: Option[String] = None, | ||
@HelpMessage("Custom banner in comment placed in rc file") | ||
banner: String = "{NAME} completions", | ||
@HelpMessage("Custom completions name") | ||
name: Option[String] = None, | ||
@HelpMessage("Completions output directory (defaults to $XDG_CONFIG_HOME/fish/completions on fish)") | ||
@Name("o") | ||
output: Option[String] = None, | ||
) | ||
// format: on | ||
|
||
object CompletionsUninstallOptions { | ||
implicit lazy val parser: Parser[CompletionsUninstallOptions] = Parser.derive | ||
implicit lazy val help: Help[CompletionsUninstallOptions] = Help.derive | ||
} |