Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bash completion #35451

Open
wants to merge 47 commits into
base: master
Choose a base branch
from
Open

Commits on Mar 1, 2023

  1. Auto TAB completion for bash using alias for occ.

    Signed-off-by: Ronald Barnes <ron@ronaldbarnes.ca>
    RonaldBarnes authored and nickvergessen committed Mar 1, 2023
    Configuration menu
    Copy the full SHA
    1d5e938 View commit details
    Browse the repository at this point in the history
  2. Updated copyright per Contribution guidelines.

    Signed-off-by: Ronald Barnes <ron@ronaldbarnes.ca>
    RonaldBarnes authored and nickvergessen committed Mar 1, 2023
    Configuration menu
    Copy the full SHA
    18f445d View commit details
    Browse the repository at this point in the history
  3. Resolved requested changes to PR.

    Signed-off-by: Ronald Barnes <ron@ronaldbarnes.ca>
    RonaldBarnes authored and nickvergessen committed Mar 1, 2023
    Configuration menu
    Copy the full SHA
    102052e View commit details
    Browse the repository at this point in the history
  4. Resolved one more comment deletion, per PR change request(s).

    Signed-off-by: Ronald Barnes <ron@ronaldbarnes.ca>
    RonaldBarnes authored and nickvergessen committed Mar 1, 2023
    Configuration menu
    Copy the full SHA
    8e87648 View commit details
    Browse the repository at this point in the history
  5. Changed getHttpdUser to searchHttpdUser through-out, per PR change re…

    …quests.
    
    Signed-off-by: Ronald Barnes <ron@ronaldbarnes.ca>
    RonaldBarnes authored and nickvergessen committed Mar 1, 2023
    Configuration menu
    Copy the full SHA
    56dfa43 View commit details
    Browse the repository at this point in the history
  6. Revised per pull request comment nextcloud#35451 (comment) as the 'co…

    …mplete' built-in handles de-duplication and sortation.
    
    Signed-off-by: Ronald Barnes <ron@ronaldbarnes.ca>
    RonaldBarnes authored and nickvergessen committed Mar 1, 2023
    Configuration menu
    Copy the full SHA
    8de4ac1 View commit details
    Browse the repository at this point in the history
  7. Reset COMP_WORDBREAKS to original value when finished.

    Add space after completed word unless it contains a colon.
    
    Signed-off-by: Ronald Barnes <ron@ronaldbarnes.ca>
    RonaldBarnes authored and nickvergessen committed Mar 1, 2023
    Configuration menu
    Copy the full SHA
    8e99a60 View commit details
    Browse the repository at this point in the history
  8. Add quotes around COMP_WORDBREAKS, else unexpected behaviour.

    Signed-off-by: Ronald Barnes <ron@ronaldbarnes.ca>
    RonaldBarnes authored and nickvergessen committed Mar 1, 2023
    Configuration menu
    Copy the full SHA
    2d091e2 View commit details
    Browse the repository at this point in the history
  9. Fixed adding '-vv' option to array: remnant overlooked in commit a86af42

    
    
    Signed-off-by: Ronald Barnes <ron@ronaldbarnes.ca>
    RonaldBarnes authored and nickvergessen committed Mar 1, 2023
    Configuration menu
    Copy the full SHA
    2aa4940 View commit details
    Browse the repository at this point in the history
  10. Added more web server user names.

    Signed-off-by: Ronald Barnes <ron@ronaldbarnes.ca>
    RonaldBarnes authored and nickvergessen committed Mar 1, 2023
    Configuration menu
    Copy the full SHA
    2751eaa View commit details
    Browse the repository at this point in the history
  11. Add user_id to completions.

    Add apps list to completions.
    Do not offer a switch as completion if it has already been chosen.
    
    Signed-off-by: Ronald Barnes <ron@ronaldbarnes.ca>
    RonaldBarnes authored and nickvergessen committed Mar 1, 2023
    Configuration menu
    Copy the full SHA
    8ea5a98 View commit details
    Browse the repository at this point in the history
  12. Web server lighthttp user name is fixed to lighttpd.

    Signed-off-by: Ronald Barnes <ron@ronaldbarnes.ca>
    RonaldBarnes authored and nickvergessen committed Mar 1, 2023
    Configuration menu
    Copy the full SHA
    7825a8f View commit details
    Browse the repository at this point in the history
  13. Added Usage: and remove unused debugging.

    Signed-off-by: Ronald Barnes <ron@ronaldbarnes.ca>
    RonaldBarnes authored and nickvergessen committed Mar 1, 2023
    Configuration menu
    Copy the full SHA
    aed5edd View commit details
    Browse the repository at this point in the history
  14. Added user_id, app, lang, and file system completions.

    Signed-off-by: Ronald Barnes <ron@ronaldbarnes.ca>
    RonaldBarnes authored and nickvergessen committed Mar 1, 2023
    Configuration menu
    Copy the full SHA
    c3a8470 View commit details
    Browse the repository at this point in the history
  15. Changed all functions to have '_occ_' prefix.

    Tidied up 'compopt' settings.
    
    Signed-off-by: Ronald Barnes <ron@ronaldbarnes.ca>
    RonaldBarnes authored and nickvergessen committed Mar 1, 2023
    Configuration menu
    Copy the full SHA
    d9ae83d View commit details
    Browse the repository at this point in the history
  16. Specify type of entity being 'unset'.

    Run 'unset bash_aliases' to remove the function from environment.
    
    Signed-off-by: Ronald Barnes <ron@ronaldbarnes.ca>
    RonaldBarnes authored and nickvergessen committed Mar 1, 2023
    Configuration menu
    Copy the full SHA
    3955590 View commit details
    Browse the repository at this point in the history
  17. Changed ownership test to file config/config.php, not ./occ

    Signed-off-by: Ronald Barnes <ron@ronaldbarnes.ca>
    RonaldBarnes authored and nickvergessen committed Mar 1, 2023
    Configuration menu
    Copy the full SHA
    e8e8e78 View commit details
    Browse the repository at this point in the history
  18. Added colour to filename when ownership mis-match.

    Signed-off-by: Ronald Barnes <ron@ronaldbarnes.ca>
    RonaldBarnes authored and nickvergessen committed Mar 1, 2023
    Configuration menu
    Copy the full SHA
    7eaeb9d View commit details
    Browse the repository at this point in the history
  19. If no ~/.bash_aliases, then offer to create /etc/profile.d/occ instead.

    Signed-off-by: Ronald Barnes <ron@ronaldbarnes.ca>
    RonaldBarnes authored and nickvergessen committed Mar 1, 2023
    Configuration menu
    Copy the full SHA
    0d650f7 View commit details
    Browse the repository at this point in the history
  20. Offer to add alias to /etc/bash.bashrc as well as ~/.bash_aliases

    Signed-off-by: Ronald Barnes <ron@ronaldbarnes.ca>
    RonaldBarnes authored and nickvergessen committed Mar 1, 2023
    Configuration menu
    Copy the full SHA
    6ddaf0f View commit details
    Browse the repository at this point in the history
  21. Option to add completion script to ~/.local/share/bash-completion/com…

    …pletions.
    
    When copying complete.occ, target file is called 'occ'.
    
    Signed-off-by: Ronald Barnes <ron@ronaldbarnes.ca>
    RonaldBarnes authored and nickvergessen committed Mar 1, 2023
    Configuration menu
    Copy the full SHA
    efa1dc3 View commit details
    Browse the repository at this point in the history
  22. If no ~/.bash_aliases, offer to append to ~/.bashrc instead of /etc/b…

    …ash.bashrc
    
    Signed-off-by: Ronald Barnes <ron@ronaldbarnes.ca>
    RonaldBarnes authored and nickvergessen committed Mar 1, 2023
    Configuration menu
    Copy the full SHA
    3fa70e7 View commit details
    Browse the repository at this point in the history
  23. Updated documentation / usage.

    Signed-off-by: Ronald Barnes <ron@ronaldbarnes.ca>
    RonaldBarnes authored and nickvergessen committed Mar 1, 2023
    Configuration menu
    Copy the full SHA
    b23f709 View commit details
    Browse the repository at this point in the history
  24. Configuration menu
    Copy the full SHA
    b9a4081 View commit details
    Browse the repository at this point in the history
  25. Added @author, reformatted @copyright.

    Signed-off-by: Ronald Barnes <ron@ronaldbarnes.ca>
    RonaldBarnes authored and nickvergessen committed Mar 1, 2023
    Configuration menu
    Copy the full SHA
    161c000 View commit details
    Browse the repository at this point in the history
  26. Refactored: removed all global persistence options, stores alias to ~…

    …/.bash_aliases or ~/.bashrc and completion file to ~/.local/share/bash-completion/completions
    
    Signed-off-by: Ronald Barnes <ron@ronaldbarnes.ca>
    RonaldBarnes authored and nickvergessen committed Mar 1, 2023
    Configuration menu
    Copy the full SHA
    f720c72 View commit details
    Browse the repository at this point in the history
  27. Changed completion script destination directory to /etc/bash_completi…

    …on.d/
    
    Renamed completion script occ.bash
    
    Signed-off-by: Ronald Barnes <ron@ronaldbarnes.ca>
    RonaldBarnes authored and nickvergessen committed Mar 1, 2023
    Configuration menu
    Copy the full SHA
    f6bbefa View commit details
    Browse the repository at this point in the history
  28. Renamed complete.occ to occ.bash

    Signed-off-by: Ronald Barnes <ron@ronaldbarnes.ca>
    RonaldBarnes authored and nickvergessen committed Mar 1, 2023
    Configuration menu
    Copy the full SHA
    a3c98c0 View commit details
    Browse the repository at this point in the history
  29. Typo in usage section.

    Signed-off-by: Ronald Barnes <ron@ronaldbarnes.ca>
    RonaldBarnes authored and nickvergessen committed Mar 1, 2023
    Configuration menu
    Copy the full SHA
    23fb524 View commit details
    Browse the repository at this point in the history
  30. Restored chown and chmod on /etc/bash_completion.d/occ.bash

    Signed-off-by: Ronald Barnes <ron@ronaldbarnes.ca>
    RonaldBarnes authored and nickvergessen committed Mar 1, 2023
    Configuration menu
    Copy the full SHA
    c78dc3c View commit details
    Browse the repository at this point in the history
  31. NextCloud to Nextcloud, camel case to snake case: phpFound to php_found

    Signed-off-by: Ronald Barnes <ron@ronaldbarnes.ca>
    RonaldBarnes authored and nickvergessen committed Mar 1, 2023
    Configuration menu
    Copy the full SHA
    0faf097 View commit details
    Browse the repository at this point in the history
  32. Switched back to ~/.local/share/bash-completion/completions/ as the t…

    …arget for occ.bash completion script.
    
    This will 'lazy load' the file once user first tries to use it.
    
    Signed-off-by: Ronald Barnes <ron@ronaldbarnes.ca>
    RonaldBarnes authored and nickvergessen committed Mar 1, 2023
    Configuration menu
    Copy the full SHA
    7eb851a View commit details
    Browse the repository at this point in the history
  33. Cleaned up TRAPs; works better with 'read' aka 'readline'.

    Signed-off-by: Ronald Barnes <ron@ronaldbarnes.ca>
    RonaldBarnes authored and nickvergessen committed Mar 1, 2023
    Configuration menu
    Copy the full SHA
    191e1d9 View commit details
    Browse the repository at this point in the history
  34. Added support for 'occ config:...': handles 'app' and 'system', 'get'…

    … and 'set'.
    
    If an accepted argument is 'file', handles that as well as 'app', 'user_id', and 'lang'.
    
    Signed-off-by: Ronald Barnes <ron@ronaldbarnes.ca>
    RonaldBarnes authored and nickvergessen committed Mar 1, 2023
    Configuration menu
    Copy the full SHA
    4b302d1 View commit details
    Browse the repository at this point in the history
  35. Option to regenerate alias if existing one found (helpful if multiple…

    … Nextcloud instances installed).
    
    Signed-off-by: Ronald Barnes <ron@ronaldbarnes.ca>
    RonaldBarnes authored and nickvergessen committed Mar 1, 2023
    Configuration menu
    Copy the full SHA
    653ded6 View commit details
    Browse the repository at this point in the history
  36. Consistent use of double vs single quotes.

    Signed-off-by: Ronald Barnes <ron@ronaldbarnes.ca>
    RonaldBarnes authored and nickvergessen committed Mar 1, 2023
    Configuration menu
    Copy the full SHA
    cfb1720 View commit details
    Browse the repository at this point in the history
  37. Changed target for occ.bash to user's ~/.local/share/bash-completion/…

    …completions from /etc/bash_completion.d/ -- overlooked it earlier.
    
    Signed-off-by: Ronald Barnes <ron@ronaldbarnes.ca>
    RonaldBarnes authored and nickvergessen committed Mar 1, 2023
    Configuration menu
    Copy the full SHA
    525f737 View commit details
    Browse the repository at this point in the history
  38. Allow occ.bash to operate from multiple aliases for admins with multi…

    …ple Nextcloud instances per machine.
    
    Each instance should have its own alias.
    
    Signed-off-by: Ronald Barnes <ron@ronaldbarnes.ca>
    RonaldBarnes authored and nickvergessen committed Mar 1, 2023
    Configuration menu
    Copy the full SHA
    f53b3d6 View commit details
    Browse the repository at this point in the history
  39. Check for uid as well as user_id (dav:list-calendars: uid; files-scan…

    …: user_id).
    
    Signed-off-by: Ronald Barnes <ron@ronaldbarnes.ca>
    RonaldBarnes authored and nickvergessen committed Mar 1, 2023
    Configuration menu
    Copy the full SHA
    8be0fbc View commit details
    Browse the repository at this point in the history
  40. Removed line of debug code.

    Signed-off-by: Ronald Barnes <ron@ronaldbarnes.ca>
    RonaldBarnes authored and nickvergessen committed Mar 1, 2023
    Configuration menu
    Copy the full SHA
    0074f5b View commit details
    Browse the repository at this point in the history
  41. Changed mode to non-executable: must be sourced for alias to persist …

    …after script finishes.
    
    Signed-off-by: Ronald Barnes <ron@ronaldbarnes.ca>
    RonaldBarnes authored and nickvergessen committed Mar 1, 2023
    Configuration menu
    Copy the full SHA
    a8248da View commit details
    Browse the repository at this point in the history
  42. Renamed script to more descriptive name and updated internal usage.

    Signed-off-by: Ronald Barnes <ron@ronaldbarnes.ca>
    RonaldBarnes authored and nickvergessen committed Mar 1, 2023
    Configuration menu
    Copy the full SHA
    295dfc7 View commit details
    Browse the repository at this point in the history
  43. Handle 'dav:move-calendar name sourceuid destinationuid'.

    Must fetch all user names before completing 'name' - which is a calendar name, not a user name.
    
    Signed-off-by: Ronald Barnes <ron@ronaldbarnes.ca>
    RonaldBarnes authored and nickvergessen committed Mar 1, 2023
    Configuration menu
    Copy the full SHA
    06761f4 View commit details
    Browse the repository at this point in the history
  44. Added two script files to build/files-checker.php

    Signed-off-by: Ronald Barnes <ron@ronaldbarnes.ca>
    RonaldBarnes authored and nickvergessen committed Mar 1, 2023
    Configuration menu
    Copy the full SHA
    0f4dcb1 View commit details
    Browse the repository at this point in the history
  45. Changed references to 'bash-add-alias.sh' to 'bash-tab-completion-occ…

    ….sh'.
    
    Signed-off-by: Ronald Barnes <ron@ronaldbarnes.ca>
    RonaldBarnes authored and nickvergessen committed Mar 1, 2023
    Configuration menu
    Copy the full SHA
    5b6b3c3 View commit details
    Browse the repository at this point in the history
  46. Indentation was off; spaces not tabs.

    Signed-off-by: Ronald Barnes <ron@ronaldbarnes.ca>
    RonaldBarnes authored and nickvergessen committed Mar 1, 2023
    Configuration menu
    Copy the full SHA
    a9eba83 View commit details
    Browse the repository at this point in the history
  47. Updated documentation for multi-host, multi-alias environments.

    Signed-off-by: Ronald Barnes <ron@ronaldbarnes.ca>
    RonaldBarnes authored and nickvergessen committed Mar 1, 2023
    Configuration menu
    Copy the full SHA
    aa0962d View commit details
    Browse the repository at this point in the history