npm install @oresoftware/ci
export my_env_var='{"value":"foo"}'
env vars have to use JSON
Progressive and typed command line parsing, with emphasis on JSON, for Node.js and TypeScript.
License: MIT License
for example:
{
name: 'env',
short: 'e',
type: Type.String,
help: 'Env to use, as in --env demo',
default: '33', // does not work yet
env: 'interos_deploy_env' // does not work yet
},
const v = parser.parse(process.argv, {
zeroedValues: false
});
by default it will make strings '', and arrays [], if there is no other value given.
for JSON it will be ''.
With a command like this:
docker run -t -i --privileged ubuntu bash foo bar baz
the first value is 'ubuntu', after that we can stop parsing, so the values will be:
[ubuntu, bash, foo, bar, baz]
so the option will be:
export default new CliParser(cliOpts, {
stopParsingUponFirstValue: true
});
docker run y
docker build x
git rev-parse
git merge
git checkout
etc.
need to check for existence of node exec options.
I am getting:
Not enough arguments to satisfy: {"name":"env","short":"e","type":"String","help":"env to use, as in --env demo","cleanName":"env"}
but cleanName is for internal usage only.
if we use, and b is a boolean type:
$ ntrs tail -is --env integration -b=true
we will get:
opts => {b: true}
values: [true]
maybe we can ignore things that come after a boolean var.
something like this:
'use strict';
interface Elem<T = any> {
name: string,
type: string,
typeOverride?: T
}
const addTypeProperty = <T>(v: Elem): Elem<T> => v;
const v: Array<Elem> = [
{name: 'foo', type: 'Boolean'},
{name: 'bar', type: 'String'},
addTypeProperty<string>({
name: 'baz',
type: 'JSON'
})
];
or like this:
const v: Array<Elem> = [
{name: 'foo', type: 'Boolean'},
{name: 'bar', type: 'String'},
addTypeProperty<string>({
name: 'baz',
type: JSON<T>
})
];
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.