]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tools/peertube.ts
Add ffmpeg tags for ffmpeg logs
[github/Chocobozzz/PeerTube.git] / server / tools / peertube.ts
index e79a7e0419a336ec15ca78b498950c35ebf81222..9e07640f05af88a6187d76a0a470fb47a163c853 100644 (file)
@@ -1,10 +1,10 @@
 #!/usr/bin/env node
 
-import * as program from 'commander'
-import {
-  version,
-  getSettings
-} from './cli'
+import { registerTSPaths } from '../helpers/register-ts-paths'
+registerTSPaths()
+
+import { CommandOptions, program } from 'commander'
+import { getSettings, version } from './cli'
 
 program
   .version(version, '-v, --version')
@@ -16,20 +16,20 @@ program
   .command('upload', 'upload a video').alias('up')
   .command('import-videos', 'import a video from a streaming platform').alias('import')
   .command('get-access-token', 'get a peertube access token', { noHelp: true }).alias('token')
-  .command('watch', 'watch a video in the terminal ✩°。⋆').alias('w')
-  .command('repl', 'initiate a REPL to access internals')
-  .command('plugins [action]', 'manage plugins on a local instance').alias('p')
+  .command('plugins [action]', 'manage instance plugins/themes').alias('p')
+  .command('redundancy [action]', 'manage instance redundancies').alias('r')
 
 /* Not Yet Implemented */
 program
-  .command('diagnostic [action]',
-           'like couple therapy, but for your instance',
-           { noHelp: true } as program.CommandOptions
-          ).alias('d')
+  .command(
+    'diagnostic [action]',
+    'like couple therapy, but for your instance',
+    { noHelp: true } as CommandOptions
+  ).alias('d')
   .command('admin',
-           'manage an instance where you have elevated rights',
-          { noHelp: true } as program.CommandOptions
-          ).alias('a')
+    'manage an instance where you have elevated rights',
+    { noHelp: true } as CommandOptions
+  ).alias('a')
 
 // help on no command
 if (!process.argv.slice(2).length) {
@@ -43,7 +43,7 @@ if (!process.argv.slice(2).length) {
      /   /                -" _/"/
     /   |    ._\\\\ |\\  |_.".-"  /
    /    |   __\\)|)|),/|_." _,."
-  /     \_."   " ") | ).-""---''--
+  /     \\_."   " ") | ).-""---''--
  (                  "/.""7__-""''
  |                   " ."._--._
  \\       \\ (_    __   ""   ".,_
@@ -65,16 +65,11 @@ getSettings()
       : 'instance ' + settings.remotes[settings.default] + ' selected'
 
     program
-      .on('--help', function () {
-        console.log()
-        console.log('  State: ' + state)
-        console.log()
-        console.log('  Examples:')
-        console.log()
-        console.log('    $ peertube auth add -u "PEERTUBE_URL" -U "PEERTUBE_USER" --password "PEERTUBE_PASSWORD"')
-        console.log('    $ peertube up <videoFile>')
-        console.log('    $ peertube watch https://peertube.cpy.re/videos/watch/e8a1af4e-414a-4d58-bfe6-2146eed06d10')
-        console.log()
-      })
+      .addHelpText('after', '\n\n  State: ' + state + '\n\n' +
+        '  Examples:\n\n' +
+        '    $ peertube auth add -u "PEERTUBE_URL" -U "PEERTUBE_USER" --password "PEERTUBE_PASSWORD"\n' +
+        '    $ peertube up <videoFile>\n'
+      )
       .parse(process.argv)
   })
+  .catch(err => console.error(err))