typescript-to-cli
typescript-to-cli copied to clipboard
Aliases
Hi @GuillaumeSalles! I really love the tool and I have a feature proposition for you. What do you think about aliases(/shortcuts)?
How could it look like?
/**
* Send ships to the specified destination
*
* @param destination the ships destination
* @alias "d"
* @param numberOfShips the number of ships to send
* @alias "ships"
* @param armed whether the ships are equipped with weapons or not
* @alias "a"
*/
export default function(
destination: string,
numberOfShips: number,
armed: boolean
) {
console.log(
`You sent ${numberOfShips} ${armed ? "armed" : ""} ships to ${destination}`
);
}
./send-ships.js --d Mars --ships 10 --a
Hi @hasparus ! I'm glad you like it!
That would be a great feature! Unfortunately, typescript parser does not seem to support @alias keyword (https://github.com/Microsoft/TypeScript/wiki/JSDoc-support-in-JavaScript) so I don't think it's trivial to implement.
This project is not actively maintained, so feel free to fork it or make a PR to add this feature.