{"id":19564439,"url":"https://github.com/wallentx/bashmenu.sh","last_synced_at":"2026-01-02T23:45:20.059Z","repository":{"id":209624837,"uuid":"724472593","full_name":"wallentx/bashmenu.sh","owner":"wallentx","description":"source \u003c(curl -sL bashmenu.sh)","archived":false,"fork":false,"pushed_at":"2024-05-14T00:07:44.000Z","size":20,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-11T09:52:38.750Z","etag":null,"topics":["bash","cli","menu","select"],"latest_commit_sha":null,"homepage":"https://bashmenu.sh","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wallentx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-28T06:28:39.000Z","updated_at":"2024-12-18T17:21:40.000Z","dependencies_parsed_at":"2023-11-28T11:26:23.429Z","dependency_job_id":"a7b3535f-8585-4d53-b299-7a7b610a135a","html_url":"https://github.com/wallentx/bashmenu.sh","commit_stats":null,"previous_names":["wallentx/bashmenu.sh"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wallentx%2Fbashmenu.sh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wallentx%2Fbashmenu.sh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wallentx%2Fbashmenu.sh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wallentx%2Fbashmenu.sh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wallentx","download_url":"https://codeload.github.com/wallentx/bashmenu.sh/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243965774,"owners_count":20375917,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bash","cli","menu","select"],"created_at":"2024-11-11T05:22:04.462Z","updated_at":"2026-01-02T23:45:20.018Z","avatar_url":"https://github.com/wallentx.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bashmenu.sh\n```bash\nsource \u003c(curl -sL bashmenu.sh)\n```\n\n## Description\n\n`bashmenu.sh` is a script offering single and multi-selection menu functionalities in bash. It is designed to be sourced into other scripts, not executed directly.\n\nThe script provides two main functions: `singleselect` and `multiselect`, each requiring specific positional arguments:\n\n- **Display Legend Flag** (string): `\"true\"` to display navigation instructions, any other value to hide them.\n- **Result Variable Name** (string): The name of the variable where the result will be stored (as an array).\n- **Options** (array): An array of strings representing the menu options.\n- **Default Selection**:\n  - For `multiselect`: An array of booleans (`true`/`false`) indicating preselected options.\n  - For `singleselect`: An integer representing the index of the default selected option.\n\n## Usage\n\n### Navigation Controls\n\n- `↓` (Down Arrow): Move cursor down\n- `↑` (Up Arrow): Move cursor up\n- `⎵` (Space): Toggle selection (for multiselect) / Make selection (for singleselect)\n- `⏎` (Enter): Confirm selection\n\n## Examples\n\n```bash\n# Source the script\nsource \u003c(curl -sL bashmenu.sh)\n\n# Define options\nmy_options=(\"Option 1\" \"Option 2\" \"Option 3\")\n\n# Using multiselect\npreselection=(\"true\" \"false\" \"false\")\nmultiselect \"true\" result my_options preselection\n\n# Using singleselect\nsingleselect \"true\" result my_options 0  # 0 is the index of the default selected option\n\n# Display the result\nidx=0\nfor option in \"${my_options[@]}\"; do\n    echo -e \"$option\\t=\u003e ${result[idx]}\"\n    ((idx++))\ndone\n```\n\n The multiselect function was based on multiselect.miu.io\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwallentx%2Fbashmenu.sh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwallentx%2Fbashmenu.sh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwallentx%2Fbashmenu.sh/lists"}