Skip to content

Commit 91be142

Browse files
committed
docs: fix
1 parent cda11df commit 91be142

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

examples/tabtab-test-complete/index.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,20 @@ const tabtab = require('../..');
1010
const args = opts._;
1111

1212
const completion = env => {
13+
const shell = tabtab.getShellFromEnv(env);
14+
1315
if (!env.complete) return;
1416

1517
if (env.prev === 'someCommand') {
16-
return tabtab.log(['is', 'this', 'the', 'real', 'life']);
18+
return tabtab.log(['is', 'this', 'the', 'real', 'life'], shell);
1719
}
1820

1921
if (env.prev === 'anotherOne') {
20-
return tabtab.log(['is', 'this', 'just', 'fantasy']);
22+
return tabtab.log(['is', 'this', 'just', 'fantasy'], shell);
2123
}
2224

2325
if (env.prev === '--loglevel') {
24-
return tabtab.log(['error', 'warn', 'info', 'notice', 'verbose']);
26+
return tabtab.log(['error', 'warn', 'info', 'notice', 'verbose'], shell);
2527
}
2628

2729
return tabtab.log([

readme.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ const opts = require('minimist')(process.argv.slice(2), {
6060

6161
const args = opts._;
6262
const completion = env => {
63+
const shell = tabtab.getShellFromEnv(env);
64+
6365
if (!env.complete) return;
6466

6567
// Write your completions there
@@ -91,7 +93,7 @@ const completion = env => {
9193
description: 'You must add a description for items with ":" in them'
9294
},
9395
'anotherOne'
94-
]);
96+
], shell);
9597
};
9698

9799
const run = async () => {

0 commit comments

Comments
 (0)