GithubHelp home page GithubHelp logo

fabervitale / deno_minimist Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 1.0 44 KB

๐Ÿ’พ Parses command line arguments. Port & rewrite of the node library minimist

License: MIT License

TypeScript 100.00%
cli deno minimist parser typescript

deno_minimist's Introduction

Hi ๐Ÿ‘‹, thanks for stopping by,

I'm Fabrizio Vitale and I like building with and talking about

Side Projects

Tools, libraries

Apps

Talks

Let's build JS Promise from scratch (2023-11-15)

ffmpeg: an introduction (2023-05-17)

The next wave of Javascript frameworks (2022-10-19)

Data fetching in react 18 applications (2022-05-18)

deno_minimist's People

Contributors

fabervitale avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

mengfxing

deno_minimist's Issues

Invalid parsing of muliple short arguments followed by assigment

The parser failes to handle the corner case where multiple short argument have an assigned at the end.

# broken behavior
$ deno run https://deno.land/x/[email protected]/examples/parse.ts -abc=def
{ _: [], a: "def" }

# multiple assignments really confuse the parser
$ deno run https://deno.land/x/[email protected]/examples/parse.ts -abc=d=e=f
{ _: [], a: "d" }

# the arguments separated out, gives the correct behavior.
$ deno run https://deno.land/x/[email protected]/examples/parse.ts -a -b -c=def
{ _: [], a: true, b: true, c: "def" }

#  even with the arguments separated out, the parser fails to account for multiple = characters.
$ deno run https://deno.land/x/[email protected]/examples/parse.ts -a -b -c=d=e=f
{ _: [], a: true, b: true, c: "d" }
$ deno run https://deno.land/x/[email protected]/examples/parse.ts -a -b -c==def
{ _: [], a: true, b: true, c: "" }

Single flag fails in chrome

When I parse -o and run the code in chrome I get a

params.js:403 Uncaught TypeError: arg.slice(...).split is not a function

from

const letters = arg.slice(1, -1).split("");

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.