Skip to content

Commit

Permalink
feat: rename start-preset -> start-widget-preset
Browse files Browse the repository at this point in the history
  • Loading branch information
lars-berger committed Nov 27, 2024
1 parent b337ef9 commit 61be297
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
5 changes: 4 additions & 1 deletion packages/client-api/src/desktop/widgets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,10 @@ export async function startWidget(
*
* Config path is relative within the Zebar config directory.
*/
export async function startPreset(configPath: string, presetName: string) {
export async function startWidgetPreset(
configPath: string,
presetName: string,
) {
// Ensure the config path ends with '.zebar.json'.
const filePath = configPath.endsWith('.zebar.json')
? configPath
Expand Down
2 changes: 1 addition & 1 deletion packages/client-api/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export * from './config';
export {
currentWidget,
startPreset,
startWidgetPreset,
type Widget,
type WidgetWindow,
} from './desktop';
Expand Down
12 changes: 6 additions & 6 deletions packages/desktop/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,19 @@ impl Cli {
pub enum CliCommand {
/// Opens a widget by its config path and chosen placement.
///
/// Config path is relative within the Zebar config directory (e.g.
/// `zebar start-widget --path starter/vanilla`).
/// Config path is relative within the Zebar config directory, e.g.
/// `zebar start-widget --path starter/vanilla`.
///
/// Starts Zebar if it is not already running.
StartWidget(StartWidgetArgs),

/// Opens a widget by its config path and a preset name.
///
/// Config path is relative within the Zebar config directory (e.g.
/// `zebar start-preset --path start/vanilla --preset default`).
/// Config path is relative within the Zebar config directory, e.g.
/// `zebar start-widget-preset --path starter/vanilla --preset default`.
///
/// Starts Zebar if it is not already running.
StartPreset(StartPresetArgs),
StartWidgetPreset(StartWidgetPresetArgs),

/// Opens all widgets that are set to launch on startup.
///
Expand Down Expand Up @@ -98,7 +98,7 @@ pub enum MonitorType {
}

#[derive(Args, Clone, Debug, PartialEq)]
pub struct StartPresetArgs {
pub struct StartWidgetPresetArgs {
/// Relative file path to widget config within the Zebar config
/// directory.
#[clap(long = "path", value_hint = clap::ValueHint::FilePath)]
Expand Down
2 changes: 1 addition & 1 deletion packages/desktop/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ async fn open_widgets_by_cli_command(
)
.await
}
CliCommand::StartPreset(args) => {
CliCommand::StartWidgetPreset(args) => {
widget_factory
.start_widget(
&args.config_path,
Expand Down

0 comments on commit 61be297

Please sign in to comment.