Skip to content

Commit c5ce258

Browse files
committed
🎉 Init
1 parent 2e9ddda commit c5ce258

File tree

3 files changed

+68
-0
lines changed

3 files changed

+68
-0
lines changed

.editorconfig

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
root = true
2+
3+
[*]
4+
indent_style = tab
5+
indent_size = 4
6+
charset = utf-8
7+
insert_final_newline = true
8+
trim_trailing_whitespace = true
9+
10+
[*.md]
11+
trim_trailing_whitespace = false
12+
13+
[{*.{coffee,cson,yml,yaml,jade,pug,rb,gemspec},{package,bower}.json,Rakefile,Gemfile}]
14+
indent_style = space
15+
indent_size = 2

src/commands.ps1

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
$cmds = @(
2+
'add',
3+
'autoclean',
4+
'bin',
5+
'cache',
6+
'check',
7+
'config',
8+
'create',
9+
'dedupe',
10+
'generate-lock-entry',
11+
'global',
12+
'help',
13+
'import',
14+
'info',
15+
'init',
16+
'install',
17+
'licenses',
18+
'link',
19+
'lockfile',
20+
'login',
21+
'logout',
22+
'list',
23+
'outdated',
24+
'owner',
25+
'pack',
26+
'prune',
27+
'publish',
28+
'remove',
29+
'run',
30+
'self-update',
31+
'tag',
32+
'team',
33+
'test',
34+
'unlink',
35+
'upgrade',
36+
'upgrade-interactive',
37+
'version',
38+
'versions',
39+
'why'
40+
)

src/completion.ps1

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
@('yarn', 'yarn.cmd') | ForEach-Object {
2+
Register-ArgumentCompleter -Native -CommandName $_ -ScriptBlock {
3+
param($wordToComplete, $commandAst, $cursorPosition)
4+
5+
. $PSScriptRoot\commands.ps1
6+
$cmds |
7+
Where-Object { $_ -like "$wordToComplete*" } |
8+
Sort-Object |
9+
ForEach-Object {
10+
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_)
11+
}
12+
}
13+
}

0 commit comments

Comments
 (0)