terminalfaker icon indicating copy to clipboard operation
terminalfaker copied to clipboard

Refactor parameter parsing to be more generic.

Open syntaxseed opened this issue 6 years ago • 2 comments

Parameter parsing needs to be more generic to read any number of params & pass an array of them to the command.

syntaxseed avatar Sep 30 '19 14:09 syntaxseed

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}
 */

deziev avatar Oct 02 '19 15:10 deziev

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

syntaxseed avatar Oct 10 '19 04:10 syntaxseed