Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/metio/tree-sitter-ssh-client-config
tree-sitter grammar for SSH client configuration files
https://github.com/metio/tree-sitter-ssh-client-config
client config grammar parser ssh tree-sitter
Last synced: 3 months ago
JSON representation
tree-sitter grammar for SSH client configuration files
- Host: GitHub
- URL: https://github.com/metio/tree-sitter-ssh-client-config
- Owner: metio
- License: cc0-1.0
- Created: 2022-03-27T11:59:55.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-05-23T02:54:09.000Z (8 months ago)
- Last Synced: 2024-05-23T03:03:45.709Z (8 months ago)
- Topics: client, config, grammar, parser, ssh, tree-sitter
- Language: C
- Homepage:
- Size: 4.27 MB
- Stars: 6
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.cargo.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Citation: CITATION.cff
Awesome Lists containing this project
README
# tree-sitter-ssh-client-config
SSH client config grammar for [tree-sitter](https://github.com/tree-sitter/tree-sitter).
## Usage
This grammar is available at [crates.io](https://crates.io/crates/tree-sitter-ssh-client-config), and you can use it together with the [Rust language binding](https://github.com/tree-sitter/tree-sitter/tree/master/lib/binding_rust).
```rust
use tree_sitter::{Parser, Language};let mut parser = Parser::new();
parser.set_language(tree_sitter_ssh_client_config::language()).expect("Error loading SSH client config grammar");
let config = "\
Host example.com
User your-name
Port 12345";
let tree = parser.parse(config, None).unwrap();
assert_eq!(tree.root_node().to_sexp(), "(client_config (host (host_value)) (user (user_value)) (port (port_value)))");
```## References
- [ssh_config man page](https://man.openbsd.org/ssh_config)