Browse Source

uploadVideo - filePath as arg

Leszek Wiesner 4 years ago
parent
commit
ba669c304b
1 changed files with 12 additions and 6 deletions
  1. 12 6
      cli/src/commands/media/uploadVideo.ts

+ 12 - 6
cli/src/commands/media/uploadVideo.ts

@@ -38,11 +38,6 @@ export default class UploadVideoCommand extends ContentDirectoryCommandBase {
   static description = 'Upload a new Video to a channel (requires a membership).'
   static flags = {
     // TODO: ...IOFlags, - providing input as json
-    filePath: flags.string({
-      char: 'f',
-      required: true,
-      description: 'Path to the media file to upload',
-    }),
     channel: flags.integer({
       char: 'c',
       required: false,
@@ -51,6 +46,14 @@ export default class UploadVideoCommand extends ContentDirectoryCommandBase {
     }),
   }
 
+  static args = [
+    {
+      name: 'filePath',
+      required: true,
+      description: 'Path to the media file to upload',
+    },
+  ]
+
   private createReadStreamWithProgressBar(filePath: string, barTitle: string, fileSize?: number) {
     // Progress CLI UX:
     // https://github.com/oclif/cli-ux#cliprogress
@@ -221,7 +224,10 @@ export default class UploadVideoCommand extends ContentDirectoryCommandBase {
 
     await this.requestAccountDecoding(account)
 
-    const { filePath, channel: inputChannelId } = this.parse(UploadVideoCommand).flags
+    const {
+      args: { filePath },
+      flags: { channel: inputChannelId },
+    } = this.parse(UploadVideoCommand)
 
     // Basic file validation
     if (!fs.existsSync(filePath)) {