5 个稳定版本

1.0.4 2021 年 12 月 30 日

#340游戏

每月 31 下载

MIT/Apache

28KB
566

newyears

关于

这是一个非常基础的跨年倒计时,默认情况下只在 12 月 31 日运行。如果强制在当前日期运行,它将倒计时到午夜。

我对 Rust 不是特别擅长,我没有太多时间去优化它,所以可能有很多错误。

示例

安装

可以通过 cargo 进行安装

cargo install newyears

或者您可以下载本目录中的原始可执行文件并运行它。

下载可执行文件可能需要修复权限

chmod +x /path/to/newyears

使用方法

newyears - A simple New Year's countdown written in Rust

usage: newyears [options]

description:
      This is a simple counter to midnight that will, by default, only run on December 31st of the current year. You can force it to run on the current day but it will only count to midnight because I wrote this in one day before New Year's and didn't have time to learn more Rust

options:
    -h, --help                        display this menu
    -r <N>, --radius <N>              set radius of the New Year's ball to the integer N (default: 7, min: 3, max: 10)
    -c <C>, --color <C>               set the color of the New Year's ball and countdown message to the color code C
    -C <char>, --circle-char <char>   set the character that the bar is comprised of (default: '|')
                                      note: must be a single character
                                      see available color codes below
    -t <N>, --circle-thickness <N>    set the thickness of the New' Years ball to the integer N (default: 1, min: 1, max: 3)
    -b <C>, --bar-color <C>           set the color of the bar to the color code C
    -B <char>, --bar-char <char>      set the character that the bar is comprised of (default: '|')
                                      note: must be a single character
    -T <N>, --bar-thickness <N>       set the thickness of the bar (default: 3, min: 1, max: 5)
    -m <string>, --message <string>   set the message that will be displayed in big ASCII text at the end of the countdown
    -M <C>, --message-color <C>       set the color of the message being displayed at the end to the color code C
    -i <C>, --time-color <C>          set the color of the countdown on the New Year's ball to the color code C
    -n, --now                         make the coutndown start immediately
                                      this effectively just makes a countdown to midnight of the current day and does not do a countdown to New Year's of the current year

color codes:
    0 - red
    1 - yellow
    2 - green
    3 - blue
    4 - cyan
    5 - magenta
    6 - white
    7 - random

source: https://github.com/alex-laycalvert/fun-scripts

by: alex-laycalvert

依赖项

~3.5MB
~59K SLoC