Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use std::path::PathBuf;
- use structopt::StructOpt;
- #[derive(Debug, StructOpt)]
- pub enum Action {
- /// Write tasks to the to-do list.
- Add {
- /// The task description text.
- #[structopt()]
- text: String,
- },
- /// Remove an entry from the to-do list by position.
- Done {
- #[structopt()]
- position: usize,
- },
- /// List all tasks in the to-do list.
- List,
- }
- #[derive(Debug, StructOpt)]
- #[structopt(
- name = "Rust To-Do CLI",
- about = "A command line to-do app written in Rust"
- )]
- pub struct CommandLineArgs {
- #[structopt(subcommand)]
- pub action: Action,
- ///Options
- #[structopt(parse(from_os_str), short, long)]
- pub todo_file: Option<PathBuf>,
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement