Skip to content

command

command作为rsup的子命令行工具,提供了在命令中交互的能力。关于命令行的使用,查看命令行功能

提供了ConfigUpdate两个子命令。

rs
#[derive(Parser, Debug)]
pub enum Commands {
    #[clap(name = "config", about = "Manage the config file")]
    Config {
        #[clap(subcommand)]
        config: ConfigOptions,
    },
    #[clap(name = "update", about = "Update the rsup binary and web client")]
    Update {
        #[clap(subcommand)]
        update: UpdateOptions,
    },
}

Config

用于管理rsup的配置文件config.toml,提供诸如查看、获取、设置的能力。

rs
#[derive(Parser, Debug)]
pub enum Options {
    #[clap(name = "list", about = "List all config attributes")]
    List,
    #[clap(name = "set", about = "Set config value")]
    Set { key: String, value: String },
    #[clap(name = "get", about = "Get config value")]
    Get { key: String },
    #[clap(name = "delete", about = "Delete config value")]
    Delete,
}

Update

用于更新rsup自身。包括了rsup可执行文件、web静态服务资源

rs
#[derive(Parser, Debug)]
pub enum Options {
    Rsup,
    Web,
}

Released under the Apache License.