Skip to content

Commit

Permalink
chore: small refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
mpalourdio committed May 10, 2024
1 parent 89546a9 commit 060c90c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ class FlhackerApplication {
fun run(): CommandLineRunner {
return CommandLineRunner { args ->
AudiofileHandler.setUp()
val cmd: CommandLine? = CliHandler.run(args)
val cmd: CommandLine = CliHandler.run(args)
try {
AudiofileHandler.extractResizeSaveArtwork(cmd?.getOptionValue(CliHandler.FILE_CMD_LONG_OPTION))
AudiofileHandler.extractResizeSaveArtwork(cmd.getOptionValue(CliHandler.FILE_CMD_LONG_OPTION))
AudiofileHandler.generateAsciiArt()
} finally {
AudiofileHandler.tearDown()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ object AudiofileHandler {
ReadOnlyFileException::class,
IOException::class
)
fun extractResizeSaveArtwork(audioFilePath: String?) {
fun extractResizeSaveArtwork(audioFilePath: String) {
val audioFile = File(audioFilePath)
val extractedArtwork = AudioFileIO.read(audioFile)
.tag
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import kotlin.system.exitProcess
object CliHandler {
const val FILE_CMD_LONG_OPTION: String = "file"

fun run(args: Array<String?>?): CommandLine? {
fun run(args: Array<String>): CommandLine {
val options = Options()
val input =
Option("f", FILE_CMD_LONG_OPTION, true, "audio file path which contains the artwork to print")
Expand Down

0 comments on commit 060c90c

Please sign in to comment.