Browse Source

Actions are now external to the args

master
Julio Biason 4 years ago
parent
commit
025e339ced
  1. 24
      src/actions.rs
  2. 5
      src/args.rs
  3. 1
      src/main.rs

24
src/actions.rs

@ -0,0 +1,24 @@
/*
NRP - Name Rust Program
Copyright (C) 2020 Julio Biason
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/// List of actions available
#[derive(Debug)]
pub enum Action {
/// Generate a name from the description.
Generate(String),
}

5
src/args.rs

@ -25,10 +25,7 @@ use clap::Arg;
// use clap::ArgMatches; // use clap::ArgMatches;
use clap::SubCommand; use clap::SubCommand;
#[derive(Debug)] use crate::actions::Action;
pub enum Action {
Generate(String),
}
#[derive(Debug)] #[derive(Debug)]
pub enum ParseError { pub enum ParseError {

1
src/main.rs

@ -16,6 +16,7 @@
along with this program. If not, see <https://www.gnu.org/licenses/>. along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
mod actions;
mod args; mod args;
fn main() { fn main() {

Loading…
Cancel
Save