feat(cli): fmt subcommand
This commit is contained in:
parent
de4ff9aa61
commit
9f1a4c84ee
2 changed files with 47 additions and 0 deletions
|
|
@ -1,12 +1,14 @@
|
|||
mod detangle;
|
||||
mod diff;
|
||||
mod execute_src_block;
|
||||
mod fmt;
|
||||
mod tangle;
|
||||
|
||||
use clap::{Parser, Subcommand};
|
||||
use clap_verbosity_flag::{InfoLevel, LevelFilter as CLevelFilter, Verbosity};
|
||||
use tracing::level_filters::LevelFilter;
|
||||
|
||||
/// Command line utility for org-mode files
|
||||
#[derive(Debug, Parser)]
|
||||
#[clap(name = "orgize-tools", version)]
|
||||
pub struct App {
|
||||
|
|
@ -19,14 +21,21 @@ pub struct App {
|
|||
|
||||
#[derive(Debug, Subcommand)]
|
||||
enum Command {
|
||||
/// Tangle source block contents to destination files
|
||||
#[clap(name = "tangle")]
|
||||
Tangle(tangle::Command),
|
||||
|
||||
/// Insert tangled file contents back to source files
|
||||
#[clap(name = "detangle")]
|
||||
Detangle(detangle::Command),
|
||||
|
||||
/// Execute source block
|
||||
#[clap(name = "execute-src-block")]
|
||||
ExecuteSrcBlock(execute_src_block::Command),
|
||||
|
||||
/// Format org-mode files
|
||||
#[clap(name = "fmt")]
|
||||
Format(fmt::Command),
|
||||
}
|
||||
|
||||
fn main() -> anyhow::Result<()> {
|
||||
|
|
@ -50,5 +59,6 @@ fn main() -> anyhow::Result<()> {
|
|||
Command::Tangle(cmd) => cmd.run(),
|
||||
Command::Detangle(cmd) => cmd.run(),
|
||||
Command::ExecuteSrcBlock(cmd) => cmd.run(),
|
||||
Command::Format(cmd) => cmd.run(),
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue