#计算器 #命令行界面

应用程序 calcul8

简单的命令行计算器

1 个稳定版本

1.0.2 2022年10月21日

#1681 in 数学

MIT 许可证

8KB
124 代码行

Calcul8 - 计算器命令行界面

Actions Status

先决条件

安装

  • 从终端运行 cargo install calcul8

使用方法

# Addition operation - you can substitute the `add` command with -a or --addition
$ calcul8 add 1 2 3 4 5 
15

# Subtraction operation - you can substitute the `sub` command with -s or --subtraction
$ calcul8 sub 8 2 1
5

# Multiplication operation - you can substitute the `mul` command with -m or --multiplication
$ calcul8 mul 20 7 4
560

# Division operation - you can substitute the `div` command with -d or --division
$ calcul8 div 8 4
2

所有命令都接受一个精度选项,这是结果的小数位数。默认值为 2。

$ calcul8 -p 3  add  30.12 40.2121 10.12312
80.455
$ calcul8 -p 4  add  30.12 40.2121 10.12312
80.4552

要查看所有命令和选项,请运行 calcul8 --help

贡献

  • 分支仓库
  • 为你的特性创建分支
  • 运行 cargo run 构建应用程序并运行它
  • 运行 cargo run -- --help 查看所有命令和选项
  • 进行你的更改
  • 为你的更改添加测试
  • 运行 cargo test 确保所有测试通过
  • 运行 cargo fmt 确保你的代码格式正确
  • 创建拉取请求

依赖关系

~1–12MB
~88K SLoC