terminalfaker
terminalfaker copied to clipboard
Refactor parameter parsing to be more generic.
Parameter parsing needs to be more generic to read any number of params & pass an array of them to the command.
implemented generic flag parser in #13
/**
* Take every element from arg array with dash '-',
* remove duplicates and invalid flags
*
* @param {String[]} args In format ['ls', '-la', '/']
* @param {String[]} supportedFlagsList Such as ['a', 'l]
* @returns {Set}
*/
Would be nice if commands could be passed an array or set of arrays with:
- command name
- array of flags
- array of non-flag parameters