Skip to content
This repository was archived by the owner on Mar 18, 2024. It is now read-only.

fentas/argsh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🗃️ archived for https://github.com/arg-sh/argsh


argsh

Latest release npm package License Continuous integration status for Linux and macOS

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
# 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

touch <your-script-name>
sudo chmod +x <your-script-name>

create argsh script from template

#!/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.

About

🐚 Argument parsing for all interpreter languages.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •