+help flags

This commit is contained in:
anon 2025-02-03 23:22:05 +01:00
parent 3200f61eec
commit e8b847bd2d
2 changed files with 182 additions and 0 deletions

12
Misc./flags/flags.md Normal file

@ -0,0 +1,12 @@
| Program | `-h` | `--help` |
| :-----: | :---: | :---: |
| Coreutils | yes | no |
| Moreutils | no | no |
| awk | yes | yes |
| gcc | no | yes |
| flex | yes | yes |
| bison | yes | yes |
i honestly thought there would be significant inconsistencies in coreutils.
i stand corrected.
with that, this is funny no more

170
Misc./flags/script.sh Executable file

@ -0,0 +1,170 @@
#!/bin/bash
RED='\033[1;31m'
RESET='\033[0m'
## Coreutils
#CMDS=(
# basename
# cat
# chgrp
# chmod
# chown
# chroot
# cp
# cut
# date
# dd
# df
# dir
# dirname
# du
# echo
# env
# expr
# false
# head
# ln
# ls
# mkdir
# mkfifo
# mknod
# mktemp
# mv
# pwd
# readlink
# rm
# rmdir
# seq
# sleep
# sort
# stty
# sync
# tail
# touch
# tr
# true
# tty
# uname
# vdir
# wc
# yes
# arch
# b2sum
# base32
# base64
# basename
# basenc
# chcon
# chroot
# cksum
# comm
# csplit
# cut
# dir
# dircolors
# dirname
# du
# env
# expand
# expr
# factor
# fmt
# fold
# head
# hostid
# id
# install
# join
# link
# logname
# md5sum
# mkfifo
# mktemp
# nice
# nl
# nohup
# nproc
# numfmt
# od
# paste
# pathchk
# pinky
# pr
# printenv
# printf
# ptx
# readlink
# realpath
# runcon
# seq
# sha1sum
# sha224sum
# sha256sum
# sha384sum
# sha512sum
# shred
# shuf
# sleep
# sort
# split
# stat
# stdbuf
# sum
# tac
# tail
# tee
# test
# timeout
# touch
# tr
# truncate
# tsort
# tty
# uname
# unexpand
# uniq
# unlink
# users
# vdir
# wc
# who
# whoami
# yes
#)
# Moreutils
CMDS=(
chronic
combine
errno
ifdata
ifne
isutf8
lckdo
mispipe
moreutils_parallel
pee
sponge
ts
vidir
vipe
zrun
)
for cmd in "${CMDS[@]}"; do
if ! command -v "$cmd" &>/dev/null; then
echo "Skipping missing command: $cmd"
continue
fi
for flag in "--help" "-h"; do
echo "Running: $cmd $flag"
$cmd $flag </dev/null &>/dev/null
EXIT_CODE=$?
if [ $EXIT_CODE -ne 0 ]; then
echo -e "${RED}ERROR: $cmd $flag failed with exit code $EXIT_CODE${RESET}"
fi
done
done