2
0
Fork 0
mirror of https://github.com/nushell/nushell synced 2025-02-14 21:18:49 +00:00
nushell/docs/commands/inc.md

31 lines
627 B
Markdown
Raw Normal View History

2019-10-06 23:27:51 +08:00
# inc
This command increments the value of variable by one.
## Examples
```shell
> open rustfmt.toml
2019-11-30 14:24:39 +13:00
━━━━━━━━━
edition
2019-11-30 14:24:39 +13:00
─────────
2018
2019-11-30 14:24:39 +13:00
━━━━━━━━━
2019-10-06 23:27:51 +08:00
> open rustfmt.toml | inc edition
2019-11-30 14:24:39 +13:00
━━━━━━━━━
edition
2019-11-30 14:24:39 +13:00
─────────
2019
2019-11-30 14:24:39 +13:00
━━━━━━━━━
2019-10-06 23:27:51 +08:00
```
```shell
> open Cargo.toml | get package.version
0.1.3
> open Cargo.toml | inc package.version --major | get package.version
1.0.0
> open Cargo.toml | inc package.version --minor | get package.version
0.2.0
> open Cargo.toml | inc package.version --patch | get package.version
0.1.4
```