Giter Club home page Giter Club logo

argsh's People

Contributors

divramod avatar fentas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

argsh's Issues

feat: integrate test automation w/ live reloading

As a developer i want to test the code i write. So it would be nice to be able to run tests with a single command.

Depends on

ToDo

  • create a argsh cli command like argsh -T -t path/to/tests (use bats)
  • implement live reloading with entr

Bug: conflict when calling argsh script from inside a argsh script

actual behavior: considering the following code

script1

# ...
# --- ACTIONS
# argsh(D|script1-d-action):         des(Do something.)
# argsh(L|script1-l-action):           des(Do something.)
# ...

script2

# ...
# --- ACTIONS
# argsh(D|script2-d-action):         des(Do something.)

# ...

script2_d_action() {
  script1 -L
}

call

script2 -D

Bug

  • this actually calls script1 -D inside script2_d_action instead of script1 -L

feat: create a argsh cli (EYODF)

As a developer i regularly create new scripts. So it would be nice to have a argsh cli tool which helps me with the repeating tasks i have to do while using argsh. As argsh is a cli tool creation helper it could "eat its own dog food".

ToDo

  • create the cli tool (use argsh)
  • feat: create argsh script argsh -I | --init
  • feat: run tests #3 argsh -T --path /path/to/your/tests
  • feat: code coverage #4 argsh -C --path /path/to/your/tests

feat: command line completion

As a developer I cant remember all flags of all scripts / tools i use. So it would be nice to have command line completion for the scripts i create with argsh.

feat: debug options

As a developer, it sometimes happens that i need to see which values the options i passed to script have. For being able to see that effortlessly, it would be nice to have a functions which prints out this information using a readable format.

ToDo

  • create the function
  • add a debug-options flag for one option
  • add a debug-options flag for all options
# example 1: print one option
hetzner --debug-options SERVER_TYPE
SERVER_TYPE: environment: <empty>; default: 'cx11'; passed: 'cx21'; current: 'cx31'

# example 2: print all options
hetzner --debug-options

Not compatible with mawk

On a fresh installed ubuntu mawk seems to be installed defaultwise. Using mawk leeds to following error

awk: .../argsh/libexec/argsh/libs/parse.awk: line 7: syntax error at or near ,
awk: .../argsh/libexec/argsh/libs/parse.awk: line 10: syntax error at or near ,
awk: .../argsh/libexec/argsh/libs/parse.awk: line 20: syntax error at or near }

Maybe solve or put into the readme.

Feature/Requests

As developers we want to be as efficient as possible when writing bash scripts. So we standardized writing bash scripts for the project with args.sh to make the code more readable and easier to extend. To reinforce these goals we need some additional features, which we will collect here. When working on a feature request, the choosen one will be stripped out of this collection issue to a own working issue.

feat: make it possible to comment out a option/action

As a developer i sometimes want to avoid a option/action being parsed by args.sh. So i need be able to indicate that a option/action shouldn't be parsed.

possible implementation

# example: use two number signs at the beginning of a line

## args(p|playbook-name): opt(PLAYBOOK_NAME) def(test) des(The playbook name.) val() reqb(D)

feat: man creator

As a developer I cant always remember, which option or action is doing what. So it would be nice to be able to call man <script_name> to see what a script is able to do.

ToDo

  • create a function which creates the boilerplate for a scripts man

feat: make it possible to make options required for actions

As a developer I want to be able to define options which are required to be passed to run an action.

todo

  • variant 1: in the action definition: make it possible to pass options with their short names to make them required

possible implementations

# example for defining it in the actions definition
# req --> requires

# args(F|floating-ips-delete): des(Create the passed floating ips.) req(p,c)
  • variant 2: in the option definition: make it possible to pass actions whith their short or long names to make them depend on this option
# example for defining it in the options definition
# reqb --> required by

# args(p|playbook-name): opt(PLAYBOOK_NAME) def(test) des(The playbook name.) val() reqb(D)

feat: validator _args_is_in_array

As a developer i want to ensure, that the user of an option only passes valid values to that option. Therefore there has to be a validator, which ensures that no invalid options are passed.

ToDo

  • in the option definition: create a validator _args_is_in_array and make it possible to pass a list of strings to that validator
# example

# args(s|server-type): opt(SERVER_TYPE) def() des(The playbook name.) val(_args_is_in_array(cx21,cx11))

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.