release under 3-clause BSD license
This commit is contained in:
parent
6e7591e009
commit
2486adf82d
2 changed files with 45 additions and 0 deletions
27
LICENSE
Normal file
27
LICENSE
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
Copyright (C) 2023 anna <owo@fef.moe>.
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without modification,
|
||||||
|
are permitted provided that the following conditions are met:
|
||||||
|
|
||||||
|
1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
this list of conditions and the following disclaimer.
|
||||||
|
|
||||||
|
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||||
|
this list of conditions and the following disclaimer in the documentation
|
||||||
|
and/or other materials provided with the distribution.
|
||||||
|
|
||||||
|
3. Neither the name of the copyright holder nor the names of its contributors
|
||||||
|
may be used to endorse or promote products derived from this software without
|
||||||
|
specific prior written permission.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||||
|
THE POSSIBILITY OF SUCH DAMAGE.
|
18
src/main.rs
18
src/main.rs
|
@ -57,6 +57,10 @@ struct Params {
|
||||||
/// Shortcut for setting the `Accept` header
|
/// Shortcut for setting the `Accept` header
|
||||||
#[arg(short = 'a', long)]
|
#[arg(short = 'a', long)]
|
||||||
accept: Option<String>,
|
accept: Option<String>,
|
||||||
|
|
||||||
|
/// Print copyright, warranty, and license information.
|
||||||
|
#[arg(long)]
|
||||||
|
license: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Copy, Clone, PartialEq, ValueEnum)]
|
#[derive(Debug, Copy, Clone, PartialEq, ValueEnum)]
|
||||||
|
@ -86,7 +90,19 @@ impl From<RequestMethod> for reqwest::Method {
|
||||||
|
|
||||||
#[tokio::main(flavor = "current_thread")]
|
#[tokio::main(flavor = "current_thread")]
|
||||||
async fn main() {
|
async fn main() {
|
||||||
|
if let Some(arg1) = env::args().nth(1) {
|
||||||
|
if arg1.as_str() == "--license" {
|
||||||
|
print!("{LICENSE}");
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let mut params = Params::parse();
|
let mut params = Params::parse();
|
||||||
|
if params.license {
|
||||||
|
print!("{LICENSE}");
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
if params.method == RequestMethod::Options {
|
if params.method == RequestMethod::Options {
|
||||||
params.headers = true;
|
params.headers = true;
|
||||||
}
|
}
|
||||||
|
@ -396,3 +412,5 @@ fn isatty(fd: i32) -> bool {
|
||||||
fn isatty(_: i32) -> bool {
|
fn isatty(_: i32) -> bool {
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const LICENSE: &str = include_str!("../LICENSE");
|
||||||
|
|
Loading…
Reference in a new issue