-
Notifications
You must be signed in to change notification settings - Fork 7
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 #23 from windymelt/init
Initコマンドを実装する
- Loading branch information
Showing
4 changed files
with
106 additions
and
15 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
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,16 @@ | ||
package com.github.windymelt.zmm | ||
|
||
import com.monovore.decline._ | ||
import com.monovore.decline.effect._ | ||
|
||
sealed trait ZmmOption | ||
final case class ShowCommand(target: String) extends ZmmOption // 今のところvoicevoxしか入らない | ||
final case class TargetFile(target: java.nio.file.Path) extends ZmmOption | ||
final case class InitializeCommand() extends ZmmOption | ||
|
||
object CliOptions { | ||
private val showCommand = Opts.subcommand(name = "show", help = "Prints information.")(Opts.argument[String]("voicevox").map(ShowCommand.apply)) | ||
private val targetFile = Opts.argument[java.nio.file.Path](metavar = "XMLFile").map(TargetFile.apply) | ||
private val initCommand = Opts.subcommand(name = "init", help = "Initializes current directory as ZMM project.")(Opts.unit.map(_ => InitializeCommand())) | ||
val opts: Opts[ZmmOption] = targetFile orElse showCommand orElse initCommand | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<content version="0.0"> | ||
<meta> | ||
<voiceconfig id="metan" backend="voicevox"> | ||
<voicevoxconfig id="2" /> | ||
</voiceconfig> | ||
<voiceconfig id="zundamon" backend="voicevox"> | ||
<voicevoxconfig id="3" /> | ||
</voiceconfig> | ||
<characterconfig name="metan" voice-id="metan" serif-color="#E14D2A" | ||
tachie-url="../../assets/めたんの立ち絵を設定してください" /> | ||
<characterconfig name="zunda" voice-id="zundamon" serif-color="#379237" | ||
tachie-url="../../assets/ずんだもんの立ち絵を設定してください" /> | ||
<dict pronounce="ゼットエムエ_ム">zmm</dict> | ||
</meta> | ||
<predef> | ||
</predef> | ||
<dialogue backgroundImage="../../assets/ここに背景画像を設定してください" bgm="assets/ここにBGMファイルを設定してください"> | ||
<scene> | ||
<say by="metan">こんにちは、四国めたんです</say> | ||
<say by="zunda">こんにちは、ずんだもんなのだ</say> | ||
<say by="metan">この原稿ファイルはzmmのサンプル原稿です</say> | ||
<say by="zunda">よろしくなのだ</say> | ||
</scene> | ||
</dialogue> | ||
</content> |