Skip to content

geoffharcourt/sydney

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sydney

Gem Version Dependency Status Build Status Code Climate

A Treetop parser for bash alias files. Organize your aliases by sections and keep comments associated with the aliases they document.

Sydney was created to feed my process an alias file and feed it to cheaters, an excellent cheatsheet system by Brett Terpstra. The output from Sydney can be a Treetop::Runtime::SyntaxNode tree, an array of the sections in your alias file, or an array of the aliases without section groupings.

Installation

Install it yourself as:

$ gem install sydney

Usage

Feed your alias file to Sydney as a single string.

Sydney.parse(IO.readlines("/my/home/folder/.aliases").join)

Sydney.parse returns a Treetop syntax tree. If you organize your alias file into sections, preceeding each section with double-banged comments, you can use Sydney.sections to return an array of Section nodes. Sydney.aliases returns an array of AliasEntry nodes, with sections flattened out.

Each section contains one or more AliasEntry nodes. An AliasEntry node ties comments (AliasComment) before an alias to the definition (AliasDefinition). See the documentation

Credits

Sydney was created and is maintained by Geoff Harcourt at Five Tool Development.

Contributing

I'm looking for further ideas for Sydney. Please report parsing issues through Github Issues. Pull requests for feature additions are welcome!

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

About

A gem for parsing bash alias files

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published