💾 Archived View for gmi.noulin.net › gitRepositories › dog › file › dog.c.gmi captured on 2023-01-29 at 13:20:32. Gemini links have been rewritten to link to archived content
-=-=-=-=-=-=-
dog.c (486B)
1 #! /usr/bin/env sheepy 2 3 #include "libsheepyObject.h" 4 5 int argc; char **argv; 6 7 #define LS "ls -al --color" 8 #define CAT "cat " 9 10 int main(int ARGC, char** ARGV) { 11 12 argc = ARGC; argv = ARGV; 13 14 initLibsheepy(argv[0]); 15 16 if (argc < 2) { 17 system(LS); 18 } 19 20 forEachCharP(&argv[1], arg) { 21 if (isDir(*arg)) { 22 char *s = appendS(LS " ", *arg); 23 systemNFreeG(s); 24 } 25 else { 26 char *s = appendS(CAT, *arg); 27 systemNFreeG(s); 28 } 29 } 30 31 finalizeLibsheepy(); 32 33 }