11/*
22* update-pandoc.ts
33*
4- * Copyright (C) 2020-2022 Posit Software, PBC
4+ * Copyright (C) 2020-2024 Posit Software, PBC
55*
66*/
7- import { Command } from "cliffy/command/mod.ts " ;
7+ import { Command , Option } from "npm:clipanion " ;
88import { join } from "../../../src/deno_ral/path.ts" ;
99import { ensureDirSync } from "../../../src/deno_ral/fs.ts" ;
1010import { info } from "../../../src/deno_ral/log.ts" ;
@@ -13,7 +13,7 @@ import {
1313 Configuration ,
1414 readConfiguration ,
1515 withWorkingDir ,
16- } from "../common /config.ts" ;
16+ } from "./config.ts" ;
1717import { lines } from "../../../src/core/text.ts" ;
1818import { pandoc } from "./dependencies/pandoc.ts" ;
1919import { archiveBinaryDependency } from "./archive-binary-dependencies.ts" ;
@@ -33,12 +33,17 @@ import {
3333
3434import * as ld from "../../../src/core/lodash.ts" ;
3535
36- export function updatePandoc ( ) {
37- return new Command ( )
38- . name ( "update-pandoc" )
39- . arguments ( "<version:string>" )
40- . description ( "Updates Pandoc to the specified version" )
41- . action ( async ( _args , version : string ) => {
36+ export class UpdatePandocCommand extends Command {
37+ static paths = [ [ "update-pandoc" ] ] ;
38+
39+ static usage = Command . Usage ( {
40+ description : "Updates Pandoc to the specified version" ,
41+ } ) ;
42+
43+ version = Option . String ( ) ;
44+
45+ async execute ( ) {
46+ const { version } = this ;
4247 info ( `Updating Pandoc to ${ version } ` ) ;
4348
4449 const configuration = readConfiguration ( ) ;
@@ -85,7 +90,7 @@ export function updatePandoc() {
8590 console . log ( bgBlack ( brightWhite ( bold (
8691 "\n** Remember to complete the checklist in /dev-docs/update-pandoc-checklist.md! **" ,
8792 ) ) ) ) ;
88- } ) ;
93+ }
8994}
9095
9196// Starting in Pandoc 3, we saw a number of variants that appear to be supported
0 commit comments