1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
use clap::Parser;
#[derive(Debug, Parser)]
#[clap(about = "A client/server interface between Kakoune and tree-sitter.")]
pub struct Cli {
/// Whether we start from Kakoune and then we should issue an initial request for setup.
#[clap(short, long)]
pub kakoune: bool,
/// Start the server, if not already started.
#[clap(short, long)]
pub server: bool,
/// Try to daemonize, if not already done.
#[clap(short, long)]
pub daemonize: bool,
/// Kakoune session to connect to.
#[clap(long)]
pub session: Option<String>,
/// Kakoune client to connect with, if any.
#[clap(short, long)]
pub client: Option<String>,
/// JSON-serialized request.
#[clap(short, long)]
pub request: Option<String>,
/// Verbosity.
///
/// Can be accumulated to get more verbosity. Without this flag, logging is disabled. Then, for each applicaton of the
/// flag, the obtained verbosity follows this order: error, warn, info, debug, trace. Thus, if you use -v, you will
/// only get error messages. If you use -vv, you will also see warnings. The maximum verbosity is achieved with -vvvvv
/// for trace logs.
#[arg(short, long, action = clap::ArgAction::Count)]
pub verbose: u8,
}