Skip to content

Commit e566c62

Browse files
committed
Add md-to-clip custom completions
Resolves #414 * Syntax source https://github.com/command-line-interface-pages/v2-tooling/tree/main/md-to-clip
1 parent 123cc5f commit e566c62

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Converter from TlDr format to Command Line Interface Pages format.
2+
# https://github.com/command-line-interface-pages/v2-tooling/tree/main/md-to-clip
3+
export extern "md-to-clip" [
4+
file: path@"nu-complete md-to-clip mdfiles" # Source tldr page to convert
5+
--help (-h) # Display help
6+
--version (-v) # Display version
7+
--author (-a) # Display author
8+
--email (-e) # Display author email
9+
--no-file-save # Whether to display conversion result in stdout instead of writing it to a file
10+
--output-directory : path@"nu-complete md-to-clip dirs" # Directory where conversion result will be written
11+
--special-placeholder-config: path # Config with special placeholders
12+
]
13+
# "old-style long switch" flags are not covered because Nushell does not currently support them https://github.com/nushell/nushell/issues/5959
14+
# `-nfs`, `-od`, `-spc`
15+
16+
def "nu-complete md-to-clip dirs" [] {
17+
ls | where type == 'dir' | get name
18+
}
19+
20+
def "nu-complete md-to-clip mdfiles" [] {
21+
ls | where type == 'dir' or name ends-with '.md' | get name
22+
}

0 commit comments

Comments
 (0)