Skip to content

Hide non-user script in underscore space to improve UX on tab autocomplete

Benefit

After merge, tab-autocomplete will fully tab autocomplete to passless-boot.sh instead of stopping at passless-boot, and fewer users are likely to be distracted by the cleanup script

Background

It's my understanding that the clean-up script is not truly intended for the user to drive, but for the service to drive. The user may be invited to arrange complex setups where they do run this themselves, but the basic case is for the service to drive it.

If those assumptions are true, then this script should be slightly hidden from the average user. Adding a prefix of one or more underscores is one common tactic that other programs such as fzf and git do to accomplish this.

i.e.

[me@my-pc:~] $ __git_
__git_eread                   __git_ps1                     __git_ps1_colorize_gitstring  __git_ps1_show_upstream       __git_sequencer_status
[me@my-pc:~] $ __fzf
__fzf_cd__                     __fzf_comprun                  __fzf_generic_path_completion  __fzf_orig_completion          
__fzfcmd                       __fzf_defc                     __fzf_history__                __fzf_select__       

This branch provides the change to the passless-boot repo including docs changes to update to this style, and below is a change for https://aur.archlinux.org/packages/passless-boot to be similarly updated.

Related PKGBUILD diff

diff --git a/PKGBUILD b/PKGBUILD
index a518b1a..d023304 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -17,7 +17,7 @@ package() {
 	cd "$pkgname-$pkgver"
 	mkdir -p "$pkgdir/usr/bin"
 	mkdir -p "$pkgdir/usr/lib/systemd/system/"
-	chmod +x passless-boot.sh passless-boot_post_boot_cleanup.sh
+	chmod +x passless-boot.sh _passless-boot_post_boot_cleanup.sh
 	cp passless-boot_post_boot_cleanup.service "$pkgdir/usr/lib/systemd/system/"
-	cp passless-boot.sh passless-boot_post_boot_cleanup.sh "$pkgdir/usr/bin"
+	cp passless-boot.sh _passless-boot_post_boot_cleanup.sh "$pkgdir/usr/bin"
 }

Testing

All changes have been tested locally and are working.

Edited by bujiraso

Merge request reports

Loading