Comments (2)
Hi, no the type
function specifies a type for each individual value, by design..
In your case, if you start with this..
const options = commandLineArgs(..)
.. and options.file
contains an array of FileDetails
instances then you could pass them into a FileList
class..
class FileList {
constructor (files) {
this.files = files
this.exists = files.every(f => f.exists)
}
}
const fileList = new FileList(options.file)
from command-line-args.
Unfortunately in my case that won’t work as it’s not files; I was just using that as an example.
I’ll have to just use strings and combine then after the fact.
from command-line-args.
Related Issues (20)
- Throw an exception if both `lazyMultiple` and `multiple` are set HOT 3
- Aliases should be nullable HOT 2
- Support for negated flags HOT 8
- recommended way to handle help? HOT 1
- Allow configuring arguments to be required HOT 3
- When trying to use a proxy such as jFrog's Artifactory, npm install fails HOT 2
- Missing argument should be error? HOT 1
- How to set a boolean value that defaults to true to false. HOT 1
- Jumping to [email protected] restrict node to >=14 HOT 2
- double hyphen is parsed as an argument when `defaultOption` is set
- Impossible to validate missing arguments for a flag when `multiple` is set HOT 1
- Parsing error of strings that starts with a digit HOT 1
- name containing dash (e.g. --num-max) supported? HOT 2
- Support concatenated .multiple for string arguments HOT 2
- Unclear behavior with defaultOption and more-than-one multiple args HOT 5
- docs for Usage guide generation is missing HOT 2
- New feature: Add a way to specify boolean value as an argument HOT 2
- What exactly is the purpose of defaultOption in multiple? HOT 1
- Support required options HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from command-line-args.