doc : bash hide modules with no public functions.
This commit is contained in:
parent
1834bf3361
commit
2f91ebc55b
|
@ -22,6 +22,9 @@ function doc_bash() {
|
|||
|
||||
# Fill with data.
|
||||
for module in $(find_module); do
|
||||
# Skip if no functions.
|
||||
[[ "$(find_function ${module} | grep -v ^_)" = "" ]] && continue
|
||||
|
||||
# Print module title.
|
||||
echo "## ${module^}." >> "${file}"
|
||||
echo >> "${file}"
|
||||
|
|
|
@ -17,3 +17,10 @@ function find_function() {
|
|||
[[ "${module}" = "" ]] && module="*"
|
||||
cat "${BASH_MODULE_PATH}"/${module}.sh | grep "^function.*()" | sed -e "s/^function //" -e "s/().*//"
|
||||
}
|
||||
|
||||
# Autocomplete with module.
|
||||
_find_module() {
|
||||
_autocomplete_first $(find_module)
|
||||
}
|
||||
|
||||
complete -F _find_module find_function
|
||||
|
|
30
.doc/bash.md
30
.doc/bash.md
|
@ -28,11 +28,6 @@ unarchive [FILES]|Extract previously created archive with checksum validation.
|
|||
archive_name [ARCHIVE] [NAME]|Rename archives. If no name specified, it simplifies archive's name. If no archives specified, apply to all archives.
|
||||
archive_convert|Convert old archives to a new format. TODO: remove me after some time when there won't be any old archives.
|
||||
|
||||
## Autocomplete.
|
||||
|
||||
Command|Description
|
||||
---|---
|
||||
|
||||
## Battery.
|
||||
|
||||
Command|Description
|
||||
|
@ -138,11 +133,6 @@ Command|Description
|
|||
---|---
|
||||
doc_bash|Generate a markdown file with all the help info. Outputs to ~/.doc/bash.md
|
||||
|
||||
## Export.
|
||||
|
||||
Command|Description
|
||||
---|---
|
||||
|
||||
## Ffmpeg.
|
||||
|
||||
Command|Description
|
||||
|
@ -274,11 +264,6 @@ Command|Description
|
|||
perm_share|Recursively change permissions to allow read sharing with group and others.
|
||||
perm|Recursively change permissions to restrict access for group and others.
|
||||
|
||||
## Ps1.
|
||||
|
||||
Command|Description
|
||||
---|---
|
||||
|
||||
## Ps.
|
||||
|
||||
Command|Description
|
||||
|
@ -298,11 +283,6 @@ Command|Description
|
|||
---|---
|
||||
rust_book|Open Rust book.
|
||||
|
||||
## Shopt.
|
||||
|
||||
Command|Description
|
||||
---|---
|
||||
|
||||
## Su.
|
||||
|
||||
Command|Description
|
||||
|
@ -360,16 +340,6 @@ Command|Description
|
|||
---|---
|
||||
try <COMMAND>|Retry command every 2 sec until it completes successfully.
|
||||
|
||||
## Umask.
|
||||
|
||||
Command|Description
|
||||
---|---
|
||||
|
||||
## Util.
|
||||
|
||||
Command|Description
|
||||
---|---
|
||||
|
||||
## Vdl.
|
||||
|
||||
Command|Description
|
||||
|
|
Reference in a new issue