License and license related flags #1
2 changed files with 23 additions and 20 deletions
19
src/cli.rs
19
src/cli.rs
|
@ -15,11 +15,21 @@
|
||||||
// along with this program. If not, see https://www.gnu.org/gpl-3.0.html.
|
// along with this program. If not, see https://www.gnu.org/gpl-3.0.html.
|
||||||
|
|
||||||
use crate::utils::dir::home_dir;
|
use crate::utils::dir::home_dir;
|
||||||
|
use crate::utils::strings::INTERACTIVE_NOTICE;
|
||||||
|
|
||||||
use clap::{ArgAction, CommandFactory, Parser, Subcommand};
|
use clap::{ArgAction, CommandFactory, Parser, Subcommand};
|
||||||
|
|
||||||
const CONFIG_FILE: &str = "/.config/gg/config.yaml";
|
const CONFIG_FILE: &str = "/.config/gg/config.yaml";
|
||||||
|
|
||||||
|
const HELP_TEMPLATE: &str = "\
|
||||||
|
{before-help}{name} {version}
|
||||||
|
{author-with-newline}{about-with-newline}
|
||||||
|
{usage-heading} {usage}
|
||||||
|
|
||||||
|
{all-args}{after-help}
|
||||||
|
|
||||||
|
";
|
||||||
|
|
||||||
//#[clap(author, version, about, long_about = None)]
|
//#[clap(author, version, about, long_about = None)]
|
||||||
#[derive(Parser, Debug)]
|
#[derive(Parser, Debug)]
|
||||||
#[clap(
|
#[clap(
|
||||||
|
@ -31,14 +41,7 @@ const CONFIG_FILE: &str = "/.config/gg/config.yaml";
|
||||||
long_about="A Rust GitOps and linkfarm orchestrator inspired by GNU Stow",
|
long_about="A Rust GitOps and linkfarm orchestrator inspired by GNU Stow",
|
||||||
subcommand_required=false,
|
subcommand_required=false,
|
||||||
arg_required_else_help=true,
|
arg_required_else_help=true,
|
||||||
help_template="\
|
help_template=HELP_TEMPLATE.to_owned()+INTERACTIVE_NOTICE,
|
||||||
{before-help}{name} {version}
|
|
||||||
{author-with-newline}{about-with-newline}
|
|
||||||
{usage-heading} {usage}
|
|
||||||
|
|
||||||
{all-args}{after-help}
|
|
||||||
|
|
||||||
",
|
|
||||||
)]
|
)]
|
||||||
pub struct Args {
|
pub struct Args {
|
||||||
/// The config file to use
|
/// The config file to use
|
||||||
|
|
|
@ -17,26 +17,26 @@
|
||||||
/// Contains the notice for interactive programs from the GPLv3's "How to Apply
|
/// Contains the notice for interactive programs from the GPLv3's "How to Apply
|
||||||
/// These Terms to Your New Programs"
|
/// These Terms to Your New Programs"
|
||||||
pub const INTERACTIVE_NOTICE: &str = "\
|
pub const INTERACTIVE_NOTICE: &str = "\
|
||||||
gg Copyright (C) 2023 Christina Sørensen <christina@cafkafk.com>
|
gg Copyright (C) 2023 Christina Sørensen <christina@cafkafk.com>
|
||||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||||
This is free software, and you are welcome to redistribute it
|
This is free software, and you are welcome to redistribute it
|
||||||
under certain conditions; type `show c' for details.
|
under certain conditions; type `show c' for details.
|
||||||
";
|
";
|
||||||
|
|
||||||
/// Contains the license part of the long notice for interactive programs from
|
/// Contains the license part of the long notice for interactive programs from
|
||||||
/// the GPLv3's "How to Apply These Terms to Your New Programs"
|
/// the GPLv3's "How to Apply These Terms to Your New Programs"
|
||||||
pub const INTERACTIVE_LICENSE: &str = "\
|
pub const INTERACTIVE_LICENSE: &str = "\
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
";
|
";
|
||||||
|
|
||||||
/// Contains the warranty part of the long notice for interactive programs from
|
/// Contains the warranty part of the long notice for interactive programs from
|
||||||
/// the GPLv3's "How to Apply These Terms to Your New Programs"
|
/// the GPLv3's "How to Apply These Terms to Your New Programs"
|
||||||
pub const INTERACTIVE_WARRANTY: &str = "\
|
pub const INTERACTIVE_WARRANTY: &str = "\
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
";
|
";
|
||||||
|
|
Loading…
Reference in a new issue