dataiku-sdk 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/cli.js +11 -5
- package/package.json +1 -1
package/dist/src/cli.js
CHANGED
|
@@ -158,6 +158,10 @@ const SHORT_FLAGS = {
|
|
|
158
158
|
f: "format",
|
|
159
159
|
o: "output",
|
|
160
160
|
};
|
|
161
|
+
/** Long-flag aliases: these are normalized to the canonical name in parseArgs. */
|
|
162
|
+
const FLAG_ALIASES = {
|
|
163
|
+
project: "project-key",
|
|
164
|
+
};
|
|
161
165
|
function parseArgs(argv) {
|
|
162
166
|
const positional = [];
|
|
163
167
|
const flags = {};
|
|
@@ -171,10 +175,11 @@ function parseArgs(argv) {
|
|
|
171
175
|
if (arg.startsWith("--")) {
|
|
172
176
|
const eqIdx = arg.indexOf("=");
|
|
173
177
|
if (eqIdx !== -1) {
|
|
174
|
-
|
|
178
|
+
const raw = arg.slice(2, eqIdx);
|
|
179
|
+
flags[FLAG_ALIASES[raw] ?? raw] = arg.slice(eqIdx + 1);
|
|
175
180
|
}
|
|
176
181
|
else {
|
|
177
|
-
const flagName = arg.slice(2);
|
|
182
|
+
const flagName = FLAG_ALIASES[arg.slice(2)] ?? arg.slice(2);
|
|
178
183
|
if (BOOLEAN_FLAGS.has(flagName)) {
|
|
179
184
|
flags[flagName] = true;
|
|
180
185
|
}
|
|
@@ -577,13 +582,14 @@ const commands = {
|
|
|
577
582
|
},
|
|
578
583
|
download: {
|
|
579
584
|
handler: async (c, a, f) => {
|
|
580
|
-
requireArgs(a, 2, "dss folder download <name-or-id> <path>");
|
|
585
|
+
requireArgs(a, 2, "dss folder download <name-or-id> <remote-path> [local-path]");
|
|
586
|
+
const localPath = a[2] ?? f["output"];
|
|
581
587
|
return c.folders.download(await resolveFolderId(c, a[0], f), a[1], {
|
|
582
|
-
localPath
|
|
588
|
+
localPath,
|
|
583
589
|
projectKey: f["project-key"],
|
|
584
590
|
});
|
|
585
591
|
},
|
|
586
|
-
usage: "dss folder download <name-or-id> <path> [--output PATH] [--project-key KEY]",
|
|
592
|
+
usage: "dss folder download <name-or-id> <remote-path> [local-path] [--output PATH] [--project-key KEY]",
|
|
587
593
|
},
|
|
588
594
|
upload: {
|
|
589
595
|
handler: async (c, a, f) => {
|