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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
mod macros;

pub mod application;
pub mod buffer;
pub mod buffer_position;
pub mod buffer_view;
pub mod client;
pub mod client_event;
pub mod command;
pub mod config;
pub mod connection;
pub mod cursor;
pub mod editor;
pub mod editor_event;
pub mod glob;
pub mod history;
pub mod json;
pub mod keymap;
pub mod lsp;
pub mod mode;
pub mod navigation_history;
pub mod pattern;
pub mod picker;
pub mod platform;
pub mod register;
pub mod serialization;
pub mod syntax;
pub mod theme;
pub mod ui;
pub mod word_database;

use argh::FromArgs;

/// Pepper
/// An opinionated modal editor to simplify code editing from the terminal
#[derive(FromArgs)]
pub struct Args {
    /// print version and quit
    #[argh(switch, short = 'v')]
    pub version: bool,

    /// load config file at path (repeatable)
    #[argh(option, short = 'c')]
    pub config: Vec<String>,

    /// session name
    #[argh(option, short = 's')]
    pub session: Option<String>,

    /// print the computed session name and exits
    #[argh(switch)]
    pub print_session: bool,

    /// displays no ui and send events on behalf of the currently focused client
    #[argh(switch)]
    pub as_focused_client: bool,

    /// displays no ui and send events on behalf of the client at index
    #[argh(option)]
    pub as_client: Option<client::TargetClient>,

    #[argh(switch)]
    /// will print to stderr frames latency
    pub profile: bool,

    /// open files at paths
    /// you can append ':<line-number>' to a path to open it at that line
    #[argh(positional)]
    pub files: Vec<String>,
}