acathur / cmd Goto Github PK
View Code? Open in Web Editor NEWCommander.js (command-line interfaces) for Deno.
License: MIT License
Commander.js (command-line interfaces) for Deno.
License: MIT License
The types defined for the function and default arguments do not allow for omitting the function argument in favour of a default, or using a regex instead of a function. The documentation suggests that this is allowed and it does work when type checking is disabled.
This issue seems to stem from trying to be clever with positional arguments. Just accepting an object with clearly typed fields {flags, doc?, fn?, regex?, default?} would address this.
Since there is no argument method how can we specify a required argument for the default command?
Hi there,
when I running your example from the readme I get the following error:
Download https://cdn.depjs.com/cmd/mod.ts
error: error sending request for url (https://cdn.depjs.com/cmd/mod.ts): error trying to connect: dns error: failed to lookup address information: Name or service not known
It seems the CDN is not longer available or registered by this domain
nslookup cdn.depjs.com 8.8.8.8
Server: 8.8.8.8
Address: 8.8.8.8#53
** server can't find cdn.depjs.com: NXDOMAIN
Is there some alternative cdn I could use to use your package with deno?
this link https://cdn.depjs.com/cmd/mod.ts
does not work
Hello, I don't know if this is an intentional API decision, but unlike .option
, .description
, etc the Command
method .arguments
returns undefined
if no arguments were passed in. This makes sense for _parseExpectedArgs
, for which .arguments
is a thin wrapper, but it makes the typesafety of chaining difficult, since typescript will infer that the returned object may be undefined and not have a .description
or .option
method. I believe this would be an easy fix, but wanted to open an issue before submitting a PR
arguments(desc: string): Command {
return this._parseExpectedArgs(desc.split(/ +/)) || this;
};
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.