Skip to content

vorpaljs/vorpal-autocomplete-fs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vorpal - File System Autocompletion

Build Status Coverage Status XO code style

An extension to Vorpal that provides File System-based tabbed autocompletion for a given command. This is an exact match of the autocomplete functionality provided in Unix commands like ls or cat.

Installation

npm install vorpal-autocomplete-fs
npm install vorpal

Getting Started

const vorpal = require('vorpal')();
const fsAutocomplete = require('vorpal-autocomplete-fs');

vorpal.delimiter('myapp$').show();

vorpal
  .command('cat [dirs...]')
  .autocomplete(fsAutocomplete());
$ node myapp.js
myapp$ cat [tab] [tab]
bin/  myapp.js  package.json  README.md
myapp~$ cat m [tab]
myapp~$ cat myapp.js

Only show directories

To omit files from the autocomplete and only show directories, pass in the directory option:

vorpal
  .command('cat [dirs...]')
  .autocomplete(fsAutocomplete({directory: true}));

License

MIT © David Caccavella

About

File System tabbed autocompletion for Vorpal

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published