Git Product home page Git Product logo

tomlq's Introduction

tomlq

I wanted a command line tool like jq for TOML. Couldn't find one, so I'm making one.

Right now you can only do one thing: Get a value from a toml file.

Given the Cargo.toml in this repo:

➜  tomlq git:(master) ✗ tomlq dependencies.toml -f Cargo.toml
0.4
➜  tomlq git:(master) ✗ echo $?
0
➜
➜  tomlq git:(master) ✗ tomlq dependencies.toml.foo -f Cargo.toml
dependencies.toml.foo not found!
➜  tomlq git:(master) ✗ echo $?
255
➜  tomlq git:(master) ✗

Contributions

Contributions are welcome! I just needed this one feature, so I haven't spent any additional time on this. If you have an idea, please feel free to open an issue, if you've implemented some additional features, please feel free to open a PR!

License

Licensed under the MIT License

tomlq's People

Contributors

4tm4j33tk4ur avatar jamesmunns avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

tomlq's Issues

tomlq package on crates.io doesn't include Cargo.lock file

The tomlq package on crates.io doesn't appear to include the Cargo.lock file in this repository, so it isn't possible to use the --locked flag to cargo install to make Cargo build the tool with the particular versions of the dependencies specified in that file. Per https://doc.rust-lang.org/cargo/commands/cargo-install.html:

The --locked flag can be used to force Cargo to use the packaged Cargo.lock file if it is available. This may be useful for ensuring reproducible builds, to use the exact same set of dependencies that were available when the package was published. It may also be useful if a newer version of a dependency is published that no longer builds on your system, or has other problems.

This came up for me recently when I tried to build an old release branch of some software that uses tomlq and is pinned to Rust 1.43.1. tomlq depends on clap, and the Cargo.lock file in this repo specifies clap version 2.26.0, but cargo install tomlq tries to use clap-2.33.3, which isn't compatible with Rust 1.43.1.

If I was able to cargo install --locked tomlq, then I'd be able to build it with Rust 1.43.1 when building the old release.

I think this just requires publishing a new version of this crate with a modern version of Cargo, as https://doc.rust-lang.org/cargo/commands/cargo-install.html notes:

Cargo did not start publishing Cargo.lock files until version 1.37, which means packages published with prior versions will not have a Cargo.lock file available.

Accept input from stdin

Hi! Thanks for your great project. It would be nice if it accepts an input from stdin, so that we may pipe outputs from, say, curl. There's no rush though!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.