awslabs / tough

Rust libraries and tools for using and generating TUF repositories
191 stars 45 forks source link

tuftool: Allow specifying version in `root init` #646

Closed stmcginnis closed 11 months ago

stmcginnis commented 11 months ago

Issue #, if available:

N/A

Description of changes:

A new repo is created by calling tuftool root init <path>. It is a common pattern when renewing an expiring root to then have to call tuftool root bump-version multiple times or tuftool root set-version.

Since this is so common, this change makes it possible to provide an optional initial version to root init to avoid needing to run multiple commmands. This adds an optional --version argument that can take a positive integer to set as the initial root version.

Testing done:

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.