Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

overwriting LICENSE silently #12

Closed
s3i7h opened this issue Dec 1, 2020 · 3 comments · Fixed by #13
Closed

overwriting LICENSE silently #12

s3i7h opened this issue Dec 1, 2020 · 3 comments · Fixed by #13
Labels
Status: PR Welcome Welcome to Pull Request Status: Proposal Request for comments

Comments

@s3i7h
Copy link
Contributor

s3i7h commented Dec 1, 2020

I wanted to generate a license text that I can copy/paste to other place, but I accidentally overwrote the LICENSE file of the project where I was in. Maybe just printing the output to stdout might be sufficient?

@azu azu added the Status: Proposal Request for comments label Dec 1, 2020
@azu
Copy link
Owner

azu commented Dec 1, 2020

Maybe just printing the output to stdout might be sufficient?

write_license(&license_text, "LICENSE").unwrap_or_else(|error| {
eprintln!("Can not write LICENSE file: {}", error);
process::exit(1);
});

Make write_license optional and it can be realized, but I do not know a suitable CLI flag name.

Probably, if a tool generates to stdout by default, it is good the tool has --output flag.
However, license-generator aims to generate LICENSE file.
So, this tool's main purpose is the opposite of that behavior.

Maybe, We need to add --output flag.

Options:
  --author input author name
  --project input project name that is required by some license
  --year input license year 
  --output path to output. Default: ./LICENSE

Output to stdout:

license-generate --output /dev/stdout

@s3i7h
Copy link
Contributor Author

s3i7h commented Dec 1, 2020

I think that's agreeable.
Can I write a PR for this?

@azu azu added the Status: PR Welcome Welcome to Pull Request label Dec 2, 2020
@azu
Copy link
Owner

azu commented Dec 2, 2020

Yes! Welcome to PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: PR Welcome Welcome to Pull Request Status: Proposal Request for comments
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants