Skip to main content

Module utils

Module utils 

Source
Expand description

CLI-specific utility functions. Utility functions for the Zoi CLI.

Structs§

PackageCompletion
Represents a package completion entry.

Functions§

ask_for_confirmation
Asks the user for confirmation with a prompt.
check_license
Checks the license of a package and prints warnings if it’s not OSI-approved or has issues.
check_path
Checks if the Zoi bin directory is in the current PATH and prints a warning if not.
format_version_full
Formats a full version string including the commit hash.
format_version_summary
Formats a version summary with branch, status, and number.
get_all_packages_for_completion
Gets all packages for shell completion.
is_admin
Checks if the current process has administrative or root privileges.
print_aligned_info
Prints information aligned with a fixed width for the key.
print_info
Prints information with a key and value.
print_repo_warning
Prints a warning if the package is from a non-standard repository.
setup_path
Sets up the PATH environment variable for the given scope.
symlink_file
Creates a symlink to a file, replacing any existing file or symlink.