[PR #1689] Clap #1494

Open
opened 2026-02-27 20:02:39 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/librespot-org/librespot/pull/1689
Author: @tsanona
Created: 2/26/2026
Status: 🔄 Open

Base: devHead: clap


📝 Commits (3)

  • 70fda63 extract set up logic from main
  • 767e75c fmt
  • cdee8af add clap and change structures for easier integration

📊 Changes

39 files changed (+2248 additions, -2999 deletions)

View changed files

📝 Cargo.lock (+376 -325)
📝 Cargo.toml (+6 -1)
build.rs (+7 -0)
📝 connect/src/state.rs (+13 -4)
📝 core/Cargo.toml (+1 -0)
📝 core/src/config.rs (+28 -70)
📝 core/src/session.rs (+39 -23)
📝 core/src/spclient.rs (+1 -1)
📝 core/src/version.rs (+16 -5)
📝 discovery/Cargo.toml (+15 -2)
discovery/build.rs (+7 -0)
📝 discovery/examples/discovery.rs (+9 -6)
📝 discovery/examples/discovery_group.rs (+10 -7)
📝 discovery/src/lib.rs (+125 -96)
📝 discovery/src/server.rs (+1 -1)
📝 examples/play.rs (+2 -2)
📝 examples/play_connect.rs (+4 -4)
📝 playback/Cargo.toml (+4 -0)
📝 playback/src/audio_backend/alsa.rs (+28 -25)
📝 playback/src/audio_backend/gstreamer.rs (+12 -18)

...and 19 more files

📄 Description

Changes to move from opt into clap cli
Done:

  • Moved cli/config code away from main.
  • Refactored some code to better fit clap (ex: implement BACKENDS list as an enum)
  • Made discovery truly conditionally compiled.

TODO:

  • It's missing some validation procedures.
  • styling to make the cli look nice.

I will continue to work on approximating this solution as close as possible to the previous cli flow.
Mean while I would love to get some comments.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/librespot-org/librespot/pull/1689 **Author:** [@tsanona](https://github.com/tsanona) **Created:** 2/26/2026 **Status:** 🔄 Open **Base:** `dev` ← **Head:** `clap` --- ### 📝 Commits (3) - [`70fda63`](https://github.com/librespot-org/librespot/commit/70fda6345e7fee419f053c46570d43f2c8ea1196) extract set up logic from main - [`767e75c`](https://github.com/librespot-org/librespot/commit/767e75ce616c5e16a918cb412b84a44713023e65) fmt - [`cdee8af`](https://github.com/librespot-org/librespot/commit/cdee8af5dc2c3ade0300dd9b26d351cb791a9520) add clap and change structures for easier integration ### 📊 Changes **39 files changed** (+2248 additions, -2999 deletions) <details> <summary>View changed files</summary> 📝 `Cargo.lock` (+376 -325) 📝 `Cargo.toml` (+6 -1) ➕ `build.rs` (+7 -0) 📝 `connect/src/state.rs` (+13 -4) 📝 `core/Cargo.toml` (+1 -0) 📝 `core/src/config.rs` (+28 -70) 📝 `core/src/session.rs` (+39 -23) 📝 `core/src/spclient.rs` (+1 -1) 📝 `core/src/version.rs` (+16 -5) 📝 `discovery/Cargo.toml` (+15 -2) ➕ `discovery/build.rs` (+7 -0) 📝 `discovery/examples/discovery.rs` (+9 -6) 📝 `discovery/examples/discovery_group.rs` (+10 -7) 📝 `discovery/src/lib.rs` (+125 -96) 📝 `discovery/src/server.rs` (+1 -1) 📝 `examples/play.rs` (+2 -2) 📝 `examples/play_connect.rs` (+4 -4) 📝 `playback/Cargo.toml` (+4 -0) 📝 `playback/src/audio_backend/alsa.rs` (+28 -25) 📝 `playback/src/audio_backend/gstreamer.rs` (+12 -18) _...and 19 more files_ </details> ### 📄 Description Changes to move from opt into clap cli Done: - Moved cli/config code away from main. - Refactored some code to better fit clap (ex: implement BACKENDS list as an enum) - Made discovery truly conditionally compiled. TODO: - It's missing some validation procedures. - styling to make the cli look nice. I will continue to work on approximating this solution as close as possible to the previous cli flow. Mean while I would love to get some comments. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/librespot#1494
No description provided.