-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cc35f40
commit f5afa92
Showing
3 changed files
with
146 additions
and
2 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,27 @@ | ||
pub mod create; | ||
|
||
use clap::Parser; | ||
|
||
#[derive(Parser, Debug)] | ||
#[command(author, version, about, long_about = None)] | ||
struct Cli { | ||
/// The subcommand after `zet` that the program will run | ||
#[clap(subcommand)] | ||
subcommand: Subcommand, | ||
} | ||
|
||
#[derive(Parser, Debug)] | ||
enum Subcommand { | ||
/// Create the Zettelkasten markdown file and open it using the default $EDITOR or `vi` if | ||
/// the env isn´t set. | ||
#[clap(visible_alias = "c")] | ||
Create, | ||
} | ||
|
||
fn main() -> std::io::Result<()> { | ||
create::run()?; | ||
Ok(()) | ||
let cli = Cli::parse(); | ||
|
||
return match cli.subcommand { | ||
Subcommand::Create => create::run(), | ||
}; | ||
Check warning on line 26 in src/main.rs GitHub Actions / clippyunneeded `return` statement
|
||
} |