Skip to content

Commit

Permalink
Rename slumber complete -> slumber completions
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasPickering committed Oct 3, 2024
1 parent 6f93818 commit b9d9bd9
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),

## [Unreleased] - ReleaseDate

### Added

- Add `slumber completions` subcommand
- Right now only static completions are available (e.g. subcommands). In the future I am to add dynamic completions based on your collection file (e.g. recipe and profile IDs)

## [2.1.0] - 2024-09-27

### Added
Expand Down
2 changes: 1 addition & 1 deletion crates/cli/src/commands.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
pub mod collections;
pub mod complete;
pub mod completions;
pub mod generate;
pub mod history;
pub mod import;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ use std::{io, process::ExitCode};

/// Generate shell completions
#[derive(Clone, Debug, Parser)]
pub struct CompleteCommand {
pub struct CompletionsCommand {
/// Shell type. Default to $SHELL
#[clap(long)]
shell: Option<Shell>,
}

impl Subcommand for CompleteCommand {
impl Subcommand for CompletionsCommand {
async fn execute(self, _: GlobalArgs) -> anyhow::Result<ExitCode> {
let shell = self
.shell
Expand Down
6 changes: 3 additions & 3 deletions crates/cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ mod commands;
mod util;

use crate::commands::{
collections::CollectionsCommand, complete::CompleteCommand,
collections::CollectionsCommand, completions::CompletionsCommand,
generate::GenerateCommand, history::HistoryCommand, import::ImportCommand,
new::NewCommand, request::RequestCommand, show::ShowCommand,
};
Expand Down Expand Up @@ -57,7 +57,7 @@ pub struct GlobalArgs {
#[derive(Clone, Debug, clap::Subcommand)]
pub enum CliCommand {
Collections(CollectionsCommand),
Complete(CompleteCommand),
Completions(CompletionsCommand),
Generate(GenerateCommand),
History(HistoryCommand),
Import(ImportCommand),
Expand All @@ -71,7 +71,7 @@ impl CliCommand {
pub async fn execute(self, global: GlobalArgs) -> anyhow::Result<ExitCode> {
match self {
Self::Collections(command) => command.execute(global).await,
Self::Complete(command) => command.execute(global).await,
Self::Completions(command) => command.execute(global).await,
Self::Generate(command) => command.execute(global).await,
Self::History(command) => command.execute(global).await,
Self::Import(command) => command.execute(global).await,
Expand Down

0 comments on commit b9d9bd9

Please sign in to comment.