idank / idank/explainshell

Feature: Actually explain shell constructs

Open
#282 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
14.2k
Forks
851
PR merge metrics
No merged PRs in 30d

Description

Hello @idank and thank you so much for making such a useful project!

One of its limitations is that, currently, it supports explaining command-line flags and arguments, from various things which have man-pages.

It does NOT support explaining basic shell contracts, let alone complicated shell constructs -- and is not opinionated on WHICH shell is being explained (sh/bash/dash/ksh/csh/zsh/etc.).

It would be nice to be able to paste in something like this:

if (( VARIABLE )); then

To inform me that the condition is taken IFF the variable $VARIABLE has been set.

This is distinct from e.g.

if [ -n "$VARIABLE" ]; then

Which takes the "true" condition only when $VARIABLE is defined AND has a nonzero content.

A similar shell construct might be

if [ -v VARIABLE ]; then

Which is identical to the first -- the -v flag returns true if its argument (VARIABLE) is a shell variable that is set at all --even if it's empty.

Do you have any plans to support something like this?

A stretch goal would be to support complicated shell expansion, e.g.

for k v in "${(@kv)zsh_associative_array}"; do

Which iterates over an associative array (in zsh, and possibly ksh) where k and v are set to the key and value of each entry.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no files, tests, or entry points. Start by locating the existing command-line flag and argument explanation path, then define which shell constructs and shell variants are in scope; done means supported constructs are explained with correct distinctions between shell semantics.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, shell
Domain
cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.