hostlist

Crates.iohostlist
lib.rshostlist
version0.3.1
sourcesrc
created_at2019-01-07 21:38:21.390055
updated_at2020-12-09 23:17:46.418836
descriptionHostlist library for Rust and CLI app
homepagehttps://github.com/jabl/hostlist
repositoryhttps://github.com/jabl/hostlist
max_upload_size
id106151
size23,981
Janne Blomqvist (jabl)

documentation

README

Hostlist

Build of master branch

This is a Rust implementation of a hostlist library. Hostlists are a syntax for expressing multiple hosts, commonly used in HPC. E.g. compute[1-3] => compute1, compute2, compute3. However it goes a bit beyond what can be done with plain bash expansions of the type compute{1..3}.

Some other tools and applications supporting hostlists are

Usage

The library provides a single public function, with the signature

pub fn expand(a_str: &str) -> Result<Vec<String>, &'static str>

This function will expand a hostlist into a list of hostnames. E.g. "foo[1-3]" will result in a vector ["foo1", "foo2", "foo3"].

Command-line utility

A so far VERY rudimentary CLI app called hostlist is included, allowing to use the expand() function from the command line.

Building only the library

If one doesn't want the command line application, one can build the library only with

cargo build --no-default-features

Commit count: 77

cargo fmt