The Apps Script API now allows to retrieve the source code of past versions. With clasp, this was made possible thanks to the [--version] option in the pull command:
clasp pull --version 23
But this command returns the current version of clasp (currently returns 1.5.3) instead of pulling the source code of a specified version of an Apps Script project.
--version option is conflict clasp --version and clasp pull --version 23.
commander.js is not accept same option in global command and sub-command.
I consider that solution is any of following to:
--versionNumber option instead of --version option.pull sub-command, use argument instead of --version option to specify version number. (ex: clasp pull 23)@RomainVialard @fossamagna Good catch!
I think clasp pull -v 23 would be good. Let's change to this.
clasp pull 23 may be OK, but it would prevent other extensions to getContents in the future.
In general, I try to mirror the API, which uses versionNumber instead of projectVersion:
https://developers.google.com/apps-script/api/reference/rest/v1/projects/getContent
But I think -v would be simpler and make sense to JavaScript developers.
@grant note that clasp pull -v 23 currently returns Clasp version number, exactly like clasp pull --version 23 (ie it conflicts with clasp -v exactly like clasp pull --version 23 conflicts with clasp --version)
OK. Then let's use --versionNumber like @fossamagna suggested?
Sure
Most helpful comment
Cause
--versionoption is conflictclasp --versionandclasp pull --version 23.commander.js is not accept same option in global command and sub-command.
Solution
I consider that solution is any of following to:
--versionNumberoption instead of--versionoption.pullsub-command, use argument instead of--versionoption to specify version number. (ex:clasp pull 23)