17 int follow = OPT_ISSET(ops,
'L');
19 if (OPT_ISSET(ops,
'f')) {
20 fields = OPT_ARG(ops,
'f');
22 if (!argv || !argv[0] || !argv[1]) {
23 zwarnnam(nam,
"%s %susage: %s [-L] [-f fields] out_array in_array",
33 int inc_all = OPT_ISSET(ops,
'a');
34 int only_dirs = OPT_ISSET(ops,
'd');
35 int only_files = OPT_ISSET(ops,
'f');
36 if (!argv || !argv[0] || !argv[1]) {
37 zwarnnam(nam,
"%s %susage: %s [-a] [-d] [-f] out_array dir",
zp_icon(
"⚠️ "),
41 return zp_dirlist_core(nam, argv[0], argv[1], inc_all, only_dirs, only_files);
47 int use_mmap = OPT_ISSET(ops,
'm');
50 if (OPT_ISSET(ops,
'0')) {
54 if (OPT_ISSET(ops,
'd')) {
55 char *a = OPT_ARG(ops,
'd');
73 delim = (
unsigned char)a[1];
77 delim = (
unsigned char)a[0];
84 if (!argv || !argv[0] || !argv[1]) {
85 zwarnnam(nam,
"%s %susage: %s [-m] [-d delim|-0] out file",
zp_icon(
"⚠️ "),
const char * zp_icon(const char *s)
Return icon string if enabled, empty string otherwise.
int zp_readfile_core(char *nam, char *outname, char *path, int use_mmap, int split, int delim)
See zpmod_fs.h for contract.
int zp_dirlist_core(char *nam, char *outname, char *dir, int inc_all, int only_dirs, int only_files)
See zpmod_fs.h for contract.
int zp_pathstat_core(char *nam, char *outname, char *inname, int follow, char *fields)
See zpmod_fs.h for contract.
int bin_zpdirlist(char *nam, char **argv, Options ops, int func)
zpdirlist builtin entrypoint
int bin_zppathstat(char *nam, char **argv, Options ops, int func)
zppathstat builtin entrypoint
static struct builtin fs_builtins[]
struct builtin * zp_get_fs_builtins(size_t *count)
int bin_zpreadfile(char *nam, char **argv, Options ops, int func)
zpreadfile builtin entrypoint
Module declaration header (mdh) for zpmod.
Prototype stub for zpmod when building out-of-tree.
Optional terminal/locale detection for emoji support in messages.
Filesystem helpers used by builtins and zpmod subcommands.
void zwarnnam(const char *, const char *,...)
Local, non-invasive shims to suppress benign vendor header warnings.