Skip to main content

SubCmd

Enum SubCmd 

Source
pub enum SubCmd {
Show 23 variants Set { alias: String, path: Vec<String>, }, Remove { alias: String, }, Rename { alias: String, new_alias: String, }, Modify { alias: String, path: Vec<String>, }, Note { alias: String, category: String, }, Denote { alias: String, category: String, }, List { part: Option<String>, }, Contain { alias: String, containers: Option<String>, }, Report { content: Vec<String>, }, Reportctl { action: String, arg: Option<String>, }, Check { line_count: Option<String>, }, Search { line_count: String, target: String, fuzzy: Option<String>, }, Todo { content: Vec<String>, }, Chat { content: Vec<String>, }, Concat { name: String, content: Vec<String>, }, Time { function: String, arg: String, }, Log { key: String, value: String, }, Change { part: String, field: String, value: String, }, Clear, Version, Help, Exit, Completion { shell: Option<String>, },
}

Variants§

§

Set

设置别名(路径/URL)

Fields

§alias: String

别名

§path: Vec<String>

路径或 URL(支持空格,多个参数会拼接)

§

Remove

删除别名

Fields

§alias: String

要删除的别名

§

Rename

重命名别名

Fields

§alias: String

原别名

§new_alias: String

新别名

§

Modify

修改别名对应的路径

Fields

§alias: String

别名

§path: Vec<String>

新路径或 URL

§

Note

标记别名为指定分类(browser/editor/vpn/outer_url/script)

Fields

§alias: String

别名

§category: String

分类: browser, editor, vpn, outer_url, script

§

Denote

解除别名的分类标记

Fields

§alias: String

别名

§category: String

分类: browser, editor, vpn, outer_url, script

§

List

列出别名

Fields

§part: Option<String>

指定 section(可选,如 path/inner_url/all 等)

§

Contain

在指定分类中查找别名

Fields

§alias: String

要搜索的别名

§containers: Option<String>

可选的分类列表(逗号分隔,如 path,browser,vpn)

§

Report

写入日报

Fields

§content: Vec<String>

日报内容(支持多个参数拼接)

§

Reportctl

日报元数据操作(new/sync/push/pull)

Fields

§action: String

操作: new / sync / push / pull

§arg: Option<String>

可选参数(new/sync 时为日期,push 时为 commit message)

§

Check

查看日报最近 N 行

Fields

§line_count: Option<String>

行数(默认 5)

§

Search

在日报中搜索关键字

Fields

§line_count: String

行数或 “all”

§target: String

搜索关键字

§fuzzy: Option<String>

可选: -f 或 -fuzzy 启用模糊匹配

§

Todo

待办备忘录(无参数进入 TUI 界面,有参数快速添加)

Fields

§content: Vec<String>

待办内容(支持多个参数拼接)

§

Chat

AI 对话(无参数进入 TUI 界面,有参数快速提问)

Fields

§content: Vec<String>

消息内容(支持多个参数拼接)

§

Concat

创建脚本

Fields

§name: String

脚本名称

§content: Vec<String>

脚本内容(可选,不提供则打开 TUI 编辑器)

§

Time

倒计时器

Fields

§function: String

功能名称(目前支持: countdown)

§arg: String

参数(时长,如 30s、5m、1h)

§

Log

日志模式设置

Fields

§key: String

设置项名称(如 mode)

§value: String

设置值(如 verbose/concise)

§

Change

直接修改配置文件中的某个字段

Fields

§part: String

section 名称

§field: String

字段名

§value: String

新值

§

Clear

清屏

§

Version

版本信息

§

Help

帮助信息

§

Exit

退出(交互模式)

§

Completion

生成 shell 补全脚本

Fields

§shell: Option<String>

shell 类型: zsh, bash, fish

Trait Implementations§

Source§

impl Debug for SubCmd

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl FromArgMatches for SubCmd

Source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

fn update_from_arg_matches_mut<'b>( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

impl Subcommand for SubCmd

Source§

fn augment_subcommands<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate Self via FromArgMatches::from_arg_matches_mut Read more
Source§

fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate self via FromArgMatches::update_from_arg_matches_mut Read more
Source§

fn has_subcommand(__clap_name: &str) -> bool

Test whether Self can parse a specific subcommand

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more