Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fentas/argsh
:shell: Argument parsing for all interpreter languages.
https://github.com/fentas/argsh
argument-parser arguments bash cli interpreted-programming-language shell
Last synced: 6 days ago
JSON representation
:shell: Argument parsing for all interpreter languages.
- Host: GitHub
- URL: https://github.com/fentas/argsh
- Owner: fentas
- License: mit
- Archived: true
- Created: 2019-04-27T08:14:28.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-03-18T13:49:47.000Z (8 months ago)
- Last Synced: 2024-10-31T21:08:30.999Z (13 days ago)
- Topics: argument-parser, arguments, bash, cli, interpreted-programming-language, shell
- Language: Shell
- Homepage: https://arg.sh
- Size: 31.3 KB
- Stars: 10
- Watchers: 3
- Forks: 3
- Open Issues: 16
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
🗃️ archived for https://github.com/arg-sh/argsh
---
# argsh
[![Latest release](https://img.shields.io/github/release/fentas/argsh.svg)](https://github.com/fentas/argsh/releases/latest)
[![npm package](https://img.shields.io/npm/v/argsh.svg)](https://www.npmjs.com/package/argsh)
[![License](https://img.shields.io/github/license/fentas/argsh.svg)](https://github.com/fentas/argsh/blob/master/LICENSE)
[![Continuous integration status for Linux and macOS](https://img.shields.io/travis/fentas/argsh/master.svg?label=travis%20build)](https://travis-ci.org/fentas/argsh)Create simple and short shell (bash) scripts with ease. `argsh` takes away the
tedious work to create your own argument parser and keeps your shell usage at bay.## Install argsh
* to be able to use argsh scripts on your system, it makes sense to install it globally
```sh
# manually
git clone https://github.com/fentas/argsh.git
cd argsh/bin
suod ln -sf argsh /usr/local/bin
```## Quick start
* Describe your arguments and `argsh` does the rest.### script template
```sh
touch
sudo chmod +x
```### create argsh script from template
```sh
#!/usr/bin/env argsh
set -eu -o pipefail# OPTIONS
# argsh(t|test-option): env(TEST_OPTION) def(false) des(A test option.) val()# ACTIONS
# PATHS
# VARIABLES
# IMPORTS
# MAIN
main() {
# dependencies# actions
for ACTION in ${ARGSH_ACTIONS}; do case "${ACTION}" in
T|test-action) test_action ;;
esac; done
}# FUNCTIONS
test_action() {
echo "$TEST_OPTION"
}# VALIDATORS
# RUN
[[ "${0}" != "${BASH_SOURCE[0]}" ]] || main "${@}"
```## Include `argsh` into your tests
Follow up.
## Honorable Mentions
Folder structure is right out copied from https://github.com/bats-core/bats-core. Also is bats used for testing. Big thanks for that.