Code Monkey home page Code Monkey logo

upt's Introduction

upt

GitHub GitHub release (latest SemVer) GitHub Workflow Status (with branch) GitHub top language Libraries.io dependency status for GitHub repo

This is a simple alternative uptime CLI tool written in Rust.

upt does not try to be equivalent to the uptime binary.
Rather it defaults to printing duration in a human-readable format.

Optionally the time / duration can be printed in ISO 8601 format by specifying the --iso flag.

Additionally, it's possible to watch the duration by adding the --watch flag.

A special feature is the ability to set the displayed uptime to zero by using the --reset flag. This does not influence the system uptime counter. This feature persists the timestamp from the moment the reset is performed. When evaluating the start time it chooses between the system uptime and the persisted timestamp to choose the latest instant.

After a reset, it's possible to force the use of the system uptime by using the --system flag.

All this is accomplished by relying on the fantastic Rust ecosystem and using preexisting crates as much as possible so as not to reinvent the wheel (e.g. using clap for CLI argument parsing and chrono for time manipulation).

Finally, a robust CI workflow is used to build release binaries for several platforms and architectures. These release artifacts include SBOM and SLSA attestation.

upt's People

Contributors

christophe-kamphaus-jemmic avatar dependabot[bot] avatar kamphaus avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

upt's Issues

Multiple \r are redundant

Printing more than one \r is redundant since one \r will already move the cursor to the start of the line.

Manually edited .upt file cannot be read

If the ~/.upt file was edited manually (eg. with vim) then upt cannot parse it even if the datetime format is valid.

upt should first trim the file content before trying to parse the datetime.
If the format is invalid, print an error to stderr.

File IO errors should also be printed to stderr. Only file not found can be ignored silently.

Release fails due to breaking changes in upload-artifact action

image

actions/upload-artifact@v4 has breaking changes.

From the release notes:

ℹ️ However, this is a major update that includes breaking changes. Artifacts created with versions v3 and below are not compatible with the v4 actions. Uploads and downloads must use the same major actions versions. There are also key differences from previous versions that may require updates to your workflows.

For more information, please see:

  1. The changelog post.
  2. The README.
  3. The migration documentation.
  4. As well as the underlying npm package, @​actions/artifact documentation.

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.