From 820d554d5fd75cf5d2ec8e2a10403972c78d55ba Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Sun, 2 Aug 2020 12:00:43 +0200 Subject: Added argument parsing (file/stdin digest) --- src/error.c | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) (limited to 'src/error.c') diff --git a/src/error.c b/src/error.c index 96ef3b1..e094a0a 100644 --- a/src/error.c +++ b/src/error.c @@ -6,22 +6,26 @@ /* By: cacharle +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/02/22 07:02:59 by cacharle #+# #+# */ -/* Updated: 2020/07/27 14:59:41 by charles ### ########.fr */ +/* Updated: 2020/08/02 09:23:37 by charles ### ########.fr */ /* */ /* ************************************************************************** */ #include "ft_ssl.h" -/* void error_command(char *command) */ -/* { */ -/* ft_putstr_fd("ft_ssl: Error: '", STDERR_FILENO); */ -/* ft_putstr_fd(command, STDERR_FILENO); */ -/* ft_putendl_fd("' is an invalid command.", STDERR_FILENO); */ -/* ft_putstr_fd("\nStandard commands:\n" */ -/* "\nMessage Digest commands:\n" */ -/* "md5\n" */ -/* "sha256\n" */ -/* "\nCipher commands:\n", */ -/* STDERR_FILENO */ -/* ); */ -/* } */ +// use in error message +/* extern t_compression_entry g_compression_table[]; */ + +void error_command(char *command) +{ + // argv[0]? + ft_putstr_fd("ft_ssl: Error: '", STDERR_FILENO); + ft_putstr_fd(command, STDERR_FILENO); + ft_putendl_fd("' is an invalid command.", STDERR_FILENO); + ft_putstr_fd("\nStandard commands:\n" + "\nMessage Digest commands:\n" + "md5\n" + "sha256\n" + "\nCipher commands:\n", + STDERR_FILENO + ); +} -- cgit