-
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.
Merge pull request #393 from alexarchambault/escape-pipe-completions
Fix '|' escaping in zsh completion output
- Loading branch information
Showing
5 changed files
with
25 additions
and
5 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
8 changes: 7 additions & 1 deletion
8
core/jvm/src/main/scala/caseapp/core/app/PlatformCommandsMethods.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 |
---|---|---|
@@ -1,11 +1,17 @@ | ||
package caseapp.core.app | ||
|
||
import java.nio.charset.StandardCharsets | ||
import java.nio.file.{Files, Paths} | ||
import java.nio.file.{Files, Paths, StandardOpenOption} | ||
|
||
trait PlatformCommandsMethods { | ||
protected def writeCompletions(script: String, dest: String): Unit = { | ||
val destPath = Paths.get(dest) | ||
Files.write(destPath, script.getBytes(StandardCharsets.UTF_8)) | ||
} | ||
protected def completeMainHook(args: Array[String]): Unit = | ||
Option(System.getenv("CASEAPP_COMPLETION_DEBUG")).foreach { pathStr => | ||
val path = Paths.get(pathStr) | ||
val output = s"completeMain(${args.toSeq})" | ||
Files.write(path, output.getBytes(StandardCharsets.UTF_8), StandardOpenOption.APPEND) | ||
} | ||
} |
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
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
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