diff options
author | Tyler Murphy <tylerm@tylerm.dev> | 2023-04-30 15:51:58 -0400 |
---|---|---|
committer | Tyler Murphy <tylerm@tylerm.dev> | 2023-04-30 15:51:58 -0400 |
commit | fa3b1ef74882597d7e809fc0924bf5d66114f535 (patch) | |
tree | f6a8b194dfb40cd27bf9a8ab2bb5153b93ccddef /src/commands/printf.c | |
parent | finish ed (diff) | |
download | lazysphere-fa3b1ef74882597d7e809fc0924bf5d66114f535.tar.gz lazysphere-fa3b1ef74882597d7e809fc0924bf5d66114f535.tar.bz2 lazysphere-fa3b1ef74882597d7e809fc0924bf5d66114f535.zip |
update help messages and use addressing range for ed s command
Diffstat (limited to 'src/commands/printf.c')
-rw-r--r-- | src/commands/printf.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/commands/printf.c b/src/commands/printf.c index 7539316..ce1631c 100644 --- a/src/commands/printf.c +++ b/src/commands/printf.c @@ -79,11 +79,19 @@ static void handle_slash(char n) { } } +static void help() { + printf("Usage printf FORMAT [ARG]...\n\n"); + printf("Format and print ARG(s) according to FORMAT (a-la C prinf)\n"); + exit(EXIT_SUCCESS); +} + COMMAND(print) { if (argc < 1) { error("usage: printf FORMAT [ARG]...\n"); } + if (streql("--help", argv[0])) help(); + size_t index = 0; int arg_index = 0; |