@ps-aux/nodebup 0.10.0 → 0.11.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. package/lib/cli/app.js +54 -45
  2. package/package.json +2 -2
package/lib/cli/app.js CHANGED
@@ -53,55 +53,63 @@ const restoreOptions = [backupTagOption, {
53
53
  convertCase: true
54
54
  }];
55
55
 
56
- const createApp = () => _nclif.CliApp.of({
57
- commands: {
58
- dir: (0, _nclif.cmdGroup)({
59
- options: singleStorageOptions,
60
- commands: {
61
- backup: (0, _nclif.cmd)({
62
- description: 'Backup a dir to the given storage',
63
- options: backupOptions,
64
- positionals: [{
65
- name: 'path',
66
- required: true
67
- }],
68
- run: (cmd, c) => c.get(_DirBackupController.DirBackupController).backup(cmd)
69
- }),
70
- restore: (0, _nclif.cmd)({
71
- description: 'Restore the storage to the given dir',
72
- options: restoreOptions,
73
- positionals: [{
74
- name: 'path',
75
- required: true
76
- }],
77
- run: (cmd, c) => c.get(_DirBackupController.DirBackupController).restore(cmd)
78
- })
79
- }
80
- }),
81
- aggr: (0, _nclif.cmdGroup)({
82
- commands: {
83
- backup: (0, _nclif.cmd)({
84
- description: 'Run backup',
85
- options: [storageNameOpt],
86
- positionals: [{
87
- name: 'aggregateName',
88
- required: true
89
- }],
90
- run: (a, c) => c.get(_AggregateBackupController.AggregateBackupController).backup(a.aggregateName)
91
- })
92
- }
93
- }),
94
- restic,
95
- pg
96
- }
97
- }).envConfig('NODEBUP').addObjectConfig(pwd => (0, _Config.readConfig)(pwd)).context(({
98
- config,
99
- inputs
100
- }) => (0, _Context.createContext)(config, inputs));
56
+ const createApp = () => {
57
+ const p = _nclif.CliApp.of({
58
+ binName: 'bup',
59
+ description: 'Data backup utility'
60
+ }, {
61
+ commands: {
62
+ dir: (0, _nclif.cmdGroup)({
63
+ options: singleStorageOptions,
64
+ commands: {
65
+ backup: (0, _nclif.cmd)({
66
+ description: 'Backup a dir to the given storage',
67
+ options: backupOptions,
68
+ positionals: [{
69
+ name: 'path',
70
+ required: true
71
+ }],
72
+ run: (cmd, c) => c.get(_DirBackupController.DirBackupController).backup(cmd)
73
+ }),
74
+ restore: (0, _nclif.cmd)({
75
+ description: 'Restore the storage to the given dir',
76
+ options: restoreOptions,
77
+ positionals: [{
78
+ name: 'path',
79
+ required: true
80
+ }],
81
+ run: (cmd, c) => c.get(_DirBackupController.DirBackupController).restore(cmd)
82
+ })
83
+ }
84
+ }),
85
+ aggr: (0, _nclif.cmdGroup)({
86
+ commands: {
87
+ backup: (0, _nclif.cmd)({
88
+ description: 'Run backup',
89
+ options: [storageNameOpt],
90
+ positionals: [{
91
+ name: 'aggregateName',
92
+ required: true
93
+ }],
94
+ run: (a, c) => c.get(_AggregateBackupController.AggregateBackupController).backup(a.aggregateName)
95
+ })
96
+ }
97
+ }),
98
+ restic,
99
+ pg
100
+ }
101
+ }).envConfig('NODEBUP').addObjectConfig(pwd => (0, _Config.readConfig)(pwd)).context(({
102
+ config,
103
+ inputs
104
+ }) => (0, _Context.createContext)(config, inputs));
105
+
106
+ return p;
107
+ };
101
108
 
102
109
  exports.createApp = createApp;
103
110
  const restic = (0, _nclif.cmdGroup)({
104
111
  options: singleStorageOptions,
112
+ description: 'Restic commands',
105
113
  commands: {
106
114
  'init-repo': (0, _nclif.cmd)({
107
115
  run: (_, c) => c.get(_ResticController.ResticController).initRepo()
@@ -121,6 +129,7 @@ const restic = (0, _nclif.cmdGroup)({
121
129
  }
122
130
  });
123
131
  const pg = (0, _nclif.cmdGroup)({
132
+ description: 'Postgres backup commands',
124
133
  options: [...singleStorageOptions, {
125
134
  name: 'pg-url',
126
135
  convertCase: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ps-aux/nodebup",
3
- "version": "0.10.0",
3
+ "version": "0.11.1",
4
4
  "description": "",
5
5
  "module": "lib/index.js",
6
6
  "main": "lib/index.js",
@@ -78,7 +78,7 @@
78
78
  },
79
79
  "dependencies": {
80
80
  "@hapi/joi": "^17.1.1",
81
- "@ps-aux/nclif": "^0.0.7-alpha.1",
81
+ "@ps-aux/nclif": "^0.9.0-alpha5",
82
82
  "@types/hapi__joi": "^17.1.8",
83
83
  "axios": "^0.24.0",
84
84
  "handlebars": "^4.7.7",