ChillerDragon / can-i-use-shell

NOTHING HERE YET
0 stars 0 forks source link

The idea #1

Open ChillerDragon opened 7 months ago

ChillerDragon commented 7 months ago

There is caniuse.com for web stating which browsers support what flags. This repo should start the same collection stating which cli tools support what flags in which versions and implemenations.

For example git --xyz was implemented in version xyz Or cut --xyz from coreutils works different in macOS than gnu linux

It can then suggest a version guard if statement at the top of the file

if [ $(git --version) -lt 82 ]
then
    echo "Error: your git is too old to run this script since it needs --xyz"
    exit 1
fi

There could also be a mention of a stricter usage of tools. Ideally you never launch git but only ever absolute paths such as /bin/git So the tool version does not change during the runtime of the script.

Such as things appearing in PATH or being removed. Due to shims being activated. PATH being edited. Or current working directory being changed.

ChillerDragon commented 7 months ago

The actual implementation is unclear. Maybe a collection of scripts that generate json or csv files with tables showing which cli flag was added in which version. And then a github pipeline for mac/linux ensuring that all flags works as promised.

So first start by collecting the data. A front end can come later. It could possibly integrate in a linter or some other development tooling. Or there could be a web page similar to caniuse.com.

ChillerDragon commented 7 months ago

https://www.github.com/koalaman/shellcheck/issues/2902

ChillerDragon commented 7 months ago

Check full man page history of all common commands and grep for deprecated

For example adduser's --gecos

See https://github.com/ddnet/ddnet-scripts/pull/51

ChillerDragon commented 1 month ago

https://youtube.com/shorts/UQlbe6Rg93I?si=ONRTJrbc-1ZoIk5U

killall might kill all xd