cmd-help-sublime-syntax icon indicating copy to clipboard operation
cmd-help-sublime-syntax copied to clipboard

"exec|export|hook|prune|reload|stdlib" in `direnv`

Open Ferenc- opened this issue 6 months ago • 1 comments

description

Image

$ bat --version

bat 0.25.0

$ COMMAND --help

direnv v2.35.0
Usage: direnv COMMAND [...ARGS]

Available commands
------------------
allow [PATH_TO_RC]:
permit [PATH_TO_RC]:
grant [PATH_TO_RC]:
  Grants direnv permission to load the given .envrc or .env file.
block [PATH_TO_RC]:
deny [PATH_TO_RC]:
disallow [PATH_TO_RC]:
revoke [PATH_TO_RC]:
  Revokes the authorization of a given .envrc or .env file.
edit [PATH_TO_RC]:
  Opens PATH_TO_RC or the current .envrc or .env into an $EDITOR and allow
  the file to be loaded afterwards.
exec DIR COMMAND [...ARGS]:
  Executes a command after loading the first .envrc or .env found in DIR
export SHELL:
  Loads an .envrc or .env and prints the diff in terms of exports.
  Supported SHELL values are: [zsh, pwsh, elvish, fish, gzenv, murex, systemd, bash, gha, json, tcsh, vim]
fetchurl <url> [<integrity-hash>]:
  Fetches a given URL into direnv's CAS
help [SHOW_PRIVATE]:
  Shows this help
hook SHELL:
  Used to setup the shell hook
prune:
  Removes old allowed files
reload:
  Triggers an env reload
status [--json]:
  Prints some debug status information
stdlib:
  Displays the stdlib available in the .envrc execution context
version [VERSION_AT_LEAST]:
  prints the version or checks that direnv is older than VERSION_AT_LEAST.

$ COMMAND --version

2.35.0

Ferenc- avatar Jun 02 '25 15:06 Ferenc-

Hi @Ferenc-, thanks for reporting this. :D

I think this ties into work that I made for #3. The true positives (correctly scoped as subcommands) probably come from code I added then. The false negatives (the inconsistencies you pointed out) are patterns we don't yet cover.

I've added a few tests to track these inconsistencies.

That said, beware that fixing those without breaking anything else may not be as easy as it looks. Our handling of subcommands and other keywords has always been super hacky, because it's difficult to tell them apart from plain text.

I'm also flagging some false positives (section headings) that may or may not be easy to fix.

Lastly, if cmd-help is useful to you, please consider giving it a star ⭐

victor-gp avatar Jun 08 '25 13:06 victor-gp