fsfe / reuse-tool

reuse is a tool for compliance with the REUSE recommendations.
https://reuse.software
399 stars 148 forks source link

Add arguments for `reuse init` #943

Closed Huy-Ngo closed 3 months ago

Huy-Ngo commented 6 months ago

When running reuse init, I'd like to be able to pass options with only missing values prompted. For example:

$ reuse init --license MPL-2.0 --license CC-BY-SA-4.0
Initializing project for REUSE.

Chosen licenses:
MPL-2.0
CC-BY-SA-4.0

What is the name of the project?

The reason for this is so that the init command can be aliased or scripted to something short and the developer doesn't have to repeat values. For example, I'd like to create a shell script for the init command like this:

project-init() {
  name=$(basename $PWD)
  reuse init --license MPL-2.0 --license CC-BY-SA-4.0 \
    --maintainer "$(git config user.name)" \
    --email "$(git config user.email)" \
    --project-name "$name" \
    --project-address "https://example.com/projects/$name"
}

It's not able to create such script with only interactive prompt as of now.

It would be also nice to have environment variable used to set default values that can be overwritten by the command line arguments.

Huy-Ngo commented 3 months ago

Close this as reuse now removed init command