Skip to content

Commit 8880b23

Browse files
committed
update
1 parent e485af5 commit 8880b23

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

lib/commands/show.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ const cmd = {
4747
alias: 'outdir',
4848
type: 'string',
4949
describe: 'Where to save source code',
50-
default: '.'
50+
default: 'fid'
5151
})
5252
.option('q', core.filters.query)
5353
.option('t', core.filters.tag)
@@ -119,8 +119,12 @@ function showProblem(problem, argv) {
119119
}
120120

121121
let filename;
122+
if (argv.outdir === 'fid') {
123+
argv.outdir = ("0000" + problem.fid).slice(-4) + '.' + problem.slug;
124+
}
122125
if (argv.gen) {
123126
file.mkdir(argv.outdir);
127+
// file.mkdir(("0000" + problem.fid).slice(-4));
124128
filename = genFileName(problem, argv);
125129
file.write(filename, code);
126130

@@ -172,6 +176,7 @@ function showProblem(problem, argv) {
172176
}
173177

174178
cmd.handler = function(argv) {
179+
175180
session.argv = argv;
176181
if (argv.keyword.length > 0) {
177182
// show specific one

lib/config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ const DEFAULT_CONFIG = {
7373
lang: 'cpp'
7474
},
7575
file: {
76-
show: '${fid}.${slug}',
76+
show: '${slug}',
7777
submission: '${fid}.${slug}.${sid}.${ac}'
7878
},
7979
color: {

0 commit comments

Comments
 (0)