From 9e5f72efb55e644f2b6d04f31b986f8843827554 Mon Sep 17 00:00:00 2001 From: Pascal Schmid Date: Sat, 18 May 2024 01:10:00 +0200 Subject: [PATCH] Provide help on wrong script invocation --- lib/find_old_mp3s.ex | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lib/find_old_mp3s.ex b/lib/find_old_mp3s.ex index f7a3419..c9f2e95 100644 --- a/lib/find_old_mp3s.ex +++ b/lib/find_old_mp3s.ex @@ -25,6 +25,20 @@ defmodule FindOldMp3s.Application do end end + defp execute({:error, :parsing_error}) do + IO.puts """ + Help command output + + Possible options: + Long option short option description + --help -h Show this help + --type -t Give some file audio file type ending like 'ogg' or 'mp3' + --path -p Root path to search files, search will be recursive + """ + + System.halt(1) + end + defp execute() do System.halt(0) end