diff --git a/.config/bash/module/doc.sh b/.config/bash/module/doc.sh index 0780027..f31006b 100644 --- a/.config/bash/module/doc.sh +++ b/.config/bash/module/doc.sh @@ -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}" diff --git a/.config/bash/module/find.sh b/.config/bash/module/find.sh index 863a3a1..f6a4462 100644 --- a/.config/bash/module/find.sh +++ b/.config/bash/module/find.sh @@ -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 diff --git a/.doc/bash.md b/.doc/bash.md index fa864cd..eddf2d0 100644 --- a/.doc/bash.md +++ b/.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 |Retry command every 2 sec until it completes successfully. -## Umask. - -Command|Description ----|--- - -## Util. - -Command|Description ----|--- - ## Vdl. Command|Description