Skip to content

Commit 69f8d14

Browse files
formatters and temp pretty option (#241)
* formatters and temp pretty option * remove useless style * missing pretty options + image style changed * version updated
1 parent 21a56de commit 69f8d14

File tree

31 files changed

+180
-52
lines changed

31 files changed

+180
-52
lines changed

lib/interface/cli/commands/board/get.cmd.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const command = new Command({
2929
if (id) {
3030
try {
3131
const board = await boardLogic.getBoardById(id);
32-
specifyOutputForArray(output, [board]);
32+
specifyOutputForArray(output, [board], argv.pretty);
3333
} catch (err) {
3434
debug(err.toString());
3535
const message = `Board '${id}' was not found`;
@@ -41,7 +41,7 @@ const command = new Command({
4141
} else if (name) {
4242
try {
4343
const board = await boardLogic.getBoardByName(name);
44-
specifyOutputForArray(output, [board]);
44+
specifyOutputForArray(output, [board], argv.pretty);
4545
} catch (err) {
4646
debug(err.toString());
4747
const message = `Board '${name}' was not found`;
@@ -51,7 +51,7 @@ const command = new Command({
5151
});
5252
}
5353
} else {
54-
specifyOutputForArray(output, await boardLogic.getAll({ name }));
54+
specifyOutputForArray(output, await boardLogic.getAll({ name }), argv.pretty);
5555
}
5656
},
5757
});

lib/interface/cli/commands/cluster/get.cmd.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const command = new Command({
2121
},
2222
handler: async (argv) => {
2323
const clusters = await cluster.getAllClusters();
24-
specifyOutputForArray(argv.output, clusters);
24+
specifyOutputForArray(argv.output, clusters, argv.pretty);
2525
},
2626
});
2727

lib/interface/cli/commands/composition/get.cmd.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const command = new Command({
3838
} else {
3939
compositions = await composition.getCompositions();
4040
}
41-
specifyOutputForArray(argv.output, compositions);
41+
specifyOutputForArray(argv.output, compositions, argv.pretty);
4242
},
4343
});
4444

lib/interface/cli/commands/context/get.cmd.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ const command = new Command({
5454
} else {
5555
contexts = await context.getContexts(data);
5656
}
57-
specifyOutputForArray(argv.output, contexts);
57+
specifyOutputForArray(argv.output, contexts, argv.pretty);
5858
},
5959
});
6060

lib/interface/cli/commands/environment/get.cmd.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const command = new Command({
3939
} else {
4040
environments = await environment.getEnvironments();
4141
}
42-
specifyOutputForArray(argv.output, environments);
42+
specifyOutputForArray(argv.output, environments, argv.pretty);
4343
},
4444
});
4545

lib/interface/cli/commands/helm/repo/get.cmd.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const command = new Command({
3838
repos.push(currRepo);
3939
} catch (err) {
4040
if (repos.length) {
41-
specifyOutputForArray(output, repos);
41+
specifyOutputForArray(output, repos, argv.pretty);
4242
}
4343

4444
debug(err.toString());
@@ -49,9 +49,9 @@ const command = new Command({
4949
});
5050
}
5151
}
52-
specifyOutputForArray(output, repos);
52+
specifyOutputForArray(output, repos, argv.pretty);
5353
} else {
54-
specifyOutputForArray(output, await helm.getAllRepos());
54+
specifyOutputForArray(output, await helm.getAllRepos(), argv.pretty);
5555
}
5656
},
5757
});

lib/interface/cli/commands/image/get.cmd.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ const command = new Command({
105105
offset,
106106
});
107107
}
108-
specifyOutputForArray(argv.output, images);
108+
specifyOutputForArray(argv.output, images, argv.pretty);
109109
},
110110
});
111111

lib/interface/cli/commands/pipeline/get.cmd.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const command = new Command({
4646
});
4747
},
4848
handler: async (argv) => {
49-
const { id: ids, name, output, d: decryptVariables } = argv;
49+
const { id: ids, name, output, d: decryptVariables, pretty} = argv;
5050
const limit = argv.limit;
5151
const offset = (argv.page - 1) * limit;
5252
const labels = prepareKeyValueFromCLIEnvOption(argv.label);
@@ -60,7 +60,7 @@ const command = new Command({
6060
pipelines.push(currPipeline);
6161
} catch (err) {
6262
if (pipelines.length) {
63-
specifyOutputForArray(output, pipelines);
63+
specifyOutputForArray(output, pipelines, pretty);
6464
}
6565

6666
debug(err.toString());
@@ -71,14 +71,14 @@ const command = new Command({
7171
});
7272
}
7373
}
74-
specifyOutputForArray(output, pipelines);
74+
specifyOutputForArray(output, pipelines, pretty);
7575
} else {
7676
specifyOutputForArray(output, await pipeline.getAll({
7777
limit,
7878
offset,
7979
name,
8080
labels,
81-
}));
81+
}), pretty);
8282
}
8383
},
8484
});

lib/interface/cli/commands/root/get.cmd.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ const get = new Command({
2424
choices: ['json', 'yaml', 'wide', 'name', 'id'],
2525
group: 'Output Options',
2626
})
27+
.option('pretty', {
28+
describe: 'Use colors and signs for output',
29+
group: 'Output Options',
30+
})
2731
.option('watch', {
2832
describe: 'Watching updates to a particular resource',
2933
alias: 'w',

lib/interface/cli/commands/runtimeEnvironments/get.cmd.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,13 @@ const command = new Command({
6262
version,
6363
extend,
6464
});
65-
specifyOutputForSingle(argv.output, currruntimeEnvironments);
65+
specifyOutputForSingle(argv.output, currruntimeEnvironments, argv.pretty);
6666
}
6767
else {
6868
specifyOutputForArray(output, await runtimeEnvironments.getAllRuntimeEnvironmentsForAccount({
6969
limit,
7070
offset,
71-
}));
71+
}), argv.pretty);
7272
}
7373
},
7474
});

0 commit comments

Comments
 (0)