mirror of
https://github.com/starship/starship.git
synced 2026-06-22 02:02:12 +07:00
feat: Add starship preset command (#4112)
* Add starship preset command * Use ValueEnum for preset command * Generate ValueEnum struct in build.rs * Use absolute paths and refactor codegen * Use dunce to canonicalize path * Use raw string literal in include_bytes! * Use .cloned() * Apply fixes * Fix path escaping * Removed error message if stdout is unavailable Co-authored-by: David Knaack <davidkna@users.noreply.github.com> Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
This commit is contained in:
+10
@@ -63,6 +63,15 @@ enum Commands {
|
||||
#[clap(flatten)]
|
||||
properties: Properties,
|
||||
},
|
||||
/// Prints a preset config
|
||||
Preset {
|
||||
/// The name of preset to be printed
|
||||
#[clap(required_unless_present("list"), value_enum)]
|
||||
name: Option<print::Preset>,
|
||||
/// List out all preset names
|
||||
#[clap(short, long)]
|
||||
list: bool,
|
||||
},
|
||||
/// Prints the computed starship configuration
|
||||
PrintConfig {
|
||||
/// Print the default instead of the computed config
|
||||
@@ -182,6 +191,7 @@ fn main() {
|
||||
print::module(&module_name, properties);
|
||||
}
|
||||
}
|
||||
Commands::Preset { name, list } => print::preset_command(name, list),
|
||||
Commands::Config { name, value } => {
|
||||
if let Some(name) = name {
|
||||
if let Some(value) = value {
|
||||
|
||||
Reference in New Issue
Block a user