main: split off reading and usage function to its own unit

This commit is contained in:
2026-01-29 04:12:33 +00:00
parent dc96e12145
commit d46ee32775
4 changed files with 118 additions and 61 deletions

31
include/arl/cli.h Normal file
View File

@@ -0,0 +1,31 @@
/* cli.h: CLI helpers
* Created: 2026-01-29
* Author: Aryadev Chavali
* License: See end of file
* Commentary:
*/
#ifndef CLI_H
#define CLI_H
#include <stdio.h>
#include <arl/lib/sv.h>
int read_file(const char *filename, sv_t *ret);
int read_pipe(FILE *pipe, sv_t *ret);
void usage(FILE *fp);
#endif
/* Copyright (C) 2026 Aryadev Chavali
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the MIT License for details.
* You may distribute and modify this code under the terms of the MIT License,
* which you should have received a copy of along with this program. If not,
* please go to <https://opensource.org/license/MIT>.
*/