Coder Social home page Coder Social logo

wwerner / bashplate Goto Github PK

View Code? Open in Web Editor NEW
15.0 1.0 1.0 3.63 MB

Bashplate generates bash script boilerplate code for option parsing and validation

Home Page: https://bashplate.wolfgang-werner.net

License: MIT License

JavaScript 0.98% HTML 8.95% Shell 14.75% TypeScript 73.34% SCSS 1.98%
bash generator option-parsing getopt

bashplate's Introduction

setup automated

Bashplate

Bashplate generates bash boilerplate code for option parsing and validation.

Currently deployed here: https://bashplate.wolfgang-werner.net

Why? Each time (long enough to forget all the details after writing the last one) I need to write a shell script:

  • ๐Ÿง "I want this to be reuseable, so I'll use proper options & help messages"
  • ๐Ÿค” "Hmmm, was it getopt or getopts? Which was the GNU and which the POSIX one? Shouldn't I use argbash?"
  • ๐Ÿ˜ค "So how does the option spec need to look like? Why is that colon at the start again? Does the following option take an argument?" and so on.
  • ๐Ÿ˜ฉ "How to I test if an argument was set? Reliably and portably?"

Now, I either:

  • Copy an old script and fiddle around in it - bad, since there is stuff to remove, I could break things and I still need to think
  • Read up on option parsing - bad, as it takes time and I have to decide between getopt, getopts and argbash
  • Just skip parameterizing the script and hard code everything - bad, obviously

So basically, I try to hack myself into writing better scripts.

If you can relate, give it a spin.

Requirements

  • POSIX compliance flavor, as I want to run in stripped down Docker containers
  • GNU flavor with long opts support, as I like short opts for one offs when typing, long opts in scripts for readability.
  • Minimum / No dependencies
  • Easy to put on the web, so I cannot lose it & don't have to install anything.

Development

Contributions welcome.

  • yarn install - Project setup
  • yarn dev - Compiles and hot-reloads for development
  • yarn build - Compiles and minifies for production
  • yarn lint - Lints code style issues (& fixes them where possible)

Pushing to master deploys to https://bashplate.wolfgang-werner.net and https://bashplate.now.sh (until vercel decides to turn off now.sh).

bashplate's People

Contributors

dependabot[bot] avatar snyk-bot avatar wwerner avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

amuessig

bashplate's Issues

Flags should not be required

grafik

Suggestion:
If a parameter gets a "flag", the required flag should be removed (the required checkbox should be unchecked).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.