Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jamiescode/bash-menu-generator
A simple bash script that will generate menus
https://github.com/jamiescode/bash-menu-generator
Last synced: 29 days ago
JSON representation
A simple bash script that will generate menus
- Host: GitHub
- URL: https://github.com/jamiescode/bash-menu-generator
- Owner: jamiescode
- License: mit
- Created: 2014-06-14T14:16:35.000Z (over 10 years ago)
- Default Branch: main
- Last Pushed: 2024-06-28T12:42:35.000Z (5 months ago)
- Last Synced: 2024-07-17T05:16:31.202Z (4 months ago)
- Language: Shell
- Size: 62.5 KB
- Stars: 56
- Watchers: 4
- Forks: 28
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
bash-menu-generator
=================A simple bash script that will generate menus.
Examples
=================![alt Bash Menu Options Example](https://raw.githubusercontent.com/JamieCruwys/bash-menu-generator/master/images/Bash%20Menu%20Options.png)
![alt Bash Menu Instructions Example](https://raw.githubusercontent.com/JamieCruwys/bash-menu-generator/master/images/Bash%20Menu%20Instructions.png)
Usage
=================I would recommend that you take a look at the [example](example.sh) to see how to use the script.
generateDialog
-----------------
**Parameter 1:** You can either use `options=()` which gives you a list of options [like this](https://raw.githubusercontent.com/JamieCruwys/bash-menu-generator/master/images/Bash%20Menu%20Options.png) OR you can use `instructions=()` which shows a set of instructions [like this](https://raw.githubusercontent.com/JamieCruwys/bash-menu-generator/master/images/Bash%20Menu%20Instructions.png).**Parameter 2:** Title for the menu. In the examples above these are "Choose an option" and "GitHub Instructions".
**Parameter 3:** Array of options or instructions to show. See the [example](example.sh)
`e.g. generateDialog "options" "Choose an option" "${options[@]}"`
Configuration
=================- **symbol** - Which character to be used to create the menu.
- **paddingSymbol** - Character to space and center the text.
- **lineLength** - How wide the menu should be.
- **charsToOption** - How much padding you want from the sides of the menu.
- **charsToName** - How much padding you want around the text.Troubleshooting
=================If you try to run the [example](example.sh) and you get the error:
```
zsh: permission denied: ./example.sh
```
Then you need to update the permissions for the file by running:
```
chmod +x example.sh
```