simonlovesyou / cling Goto Github PK
View Code? Open in Web Editor NEWMain repository for the cling project
License: MIT License
Main repository for the cling project
License: MIT License
Propagate unknown arguments from the parser at the root level but also on each command
const schema = parser({
commands: {
foo: {}
}
} as const, {})
argv: baz
should output
{
commands: {
_unknown: [{
name: 'baz'
}]
}
}
argv: baz quux
should output
{
commands: {
_unknown: [{ name: 'baz', _unknown: [{ value: 'quux' }] }]
}
}
argv: baz --quux=foo
should output
{
commands: {
_unknown: [{
name: 'baz',
_unknown: [{
name: 'quux',
value: 'foo'
}]
}]
}
argv: foo --quux=foo
should output
{
commands: {
foo: {
_unknown: [{
name: 'quux',
value: 'foo'
}
}
cling({
arguments: {
role: {
type: 'string',
enum: ['user', 'admin'],
description: "The users' role"
}
}
} as const)
should output the following help output:
Usage:
cli --role (user|admin)
Options:
-h --help Show this screen.
Arguments:
--role The users' role in the organization. (user|admin)
Add runtime & static logic for determining whether or not a argument / option has a conflicting name.
Static logic does not seem to be possible yet, see this PR
Should be cleaned up similar to how @cling/cling was improved in #2
cling({
arguments: {
email: {
type: 'array',
items: [{
type: 'string'
}, {
type: 'number'
}],
// description: "The users' email",
},
age: {
type: 'integer'
},
}
} as const)
will output Usage: test [--email],[--age]
, should be Usage: test [--email] [--age]
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.