From 63144032c19aa280815642f59df40b25d6ab2458 Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 25 Apr 2025 22:06:51 +1200 Subject: [PATCH] Make ds an alias for dropshell! --- CMakeLists.txt | 20 ++++++++++++++++++++ src/dropshell-completion.bash | 3 ++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fdb7836..6f851a2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -51,12 +51,32 @@ install(TARGETS dropshell RUNTIME DESTINATION bin ) +# Create symbolic link 'ds' pointing to 'dropshell' +install(CODE " + message(STATUS \"Creating symlink: ds -> dropshell\") + execute_process( + COMMAND ${CMAKE_COMMAND} -E create_symlink + \${CMAKE_INSTALL_PREFIX}/bin/dropshell + \${CMAKE_INSTALL_PREFIX}/bin/ds + ) +") + # Install completion script install(FILES src/dropshell-completion.bash DESTINATION /etc/bash_completion.d RENAME dropshell ) +# Create a symlink for the completion script to work with 'ds' command +install(CODE " + message(STATUS \"Creating completion script symlink for 'ds'\") + execute_process( + COMMAND ${CMAKE_COMMAND} -E create_symlink + /etc/bash_completion.d/dropshell + /etc/bash_completion.d/ds + ) +") + # Create pre-install script to clean old templates install(CODE " message(STATUS \"Removing old template files...\") diff --git a/src/dropshell-completion.bash b/src/dropshell-completion.bash index dfbe4f1..8adbed5 100755 --- a/src/dropshell-completion.bash +++ b/src/dropshell-completion.bash @@ -48,4 +48,5 @@ _dropshell_completions() { } # Register the completion function -complete -F _dropshell_completions dropshell \ No newline at end of file +complete -F _dropshell_completions dropshell +complete -F _dropshell_completions ds \ No newline at end of file