Skip to content

Commit 73a0a2f

Browse files
sync from internal repository
1 parent 3ee340b commit 73a0a2f

File tree

8 files changed

+14
-77
lines changed

8 files changed

+14
-77
lines changed

README.md

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,3 @@
11
# dkdc-links
22

33
***Bookmarks in your terminal.***
4-
5-
## Setup
6-
7-
### Prerequisites
8-
9-
[Install Rust and Cargo](https://doc.rust-lang.org/cargo/getting-started/installation.html):
10-
11-
```bash
12-
curl https://sh.rustup.rs -sSf | sh
13-
```
14-
15-
### Installation
16-
17-
Install [`dkdc-links`](https://crates.io/crates/dkdc-links):
18-
19-
```bash
20-
cargo install dkdc-links
21-
```
22-
23-
> [!TIP]
24-
> Consider aliasing `dkdc-links` to `links` or similar.
25-
26-
## Usage
27-
28-
To view aliases and links:
29-
30-
```bash
31-
dkdc-links
32-
```
33-
34-
To open aliases and links:
35-
36-
```bash
37-
dkdc-links alias1 link1
38-
```
39-
40-
To edit aliases and links:
41-
42-
> [!TIP]
43-
> Configure `$EDITOR` to use your preferred text editor.
44-
45-
```bash
46-
dkdc-links --config
47-
```
48-
49-
Use `dkdc-links --help` for more information.

dkdc-links-py/Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dkdc-links-py/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[package]
44
name = "dkdc-links-py"
5-
version = "2.0.0"
5+
version = "2.0.1"
66
edition = "2024"
77
authors = ["Cody <cody@dkdc.dev>"]
88
license = "MIT"

dkdc-links/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dkdc-links/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[package]
44
name = "dkdc-links"
5-
version = "2.0.0"
5+
version = "2.0.1"
66
edition = "2024"
77
authors = ["Cody <cody@dkdc.dev>"]
88
description = "Bookmarks in your terminal"

dkdc-links/src/cli.rs

Lines changed: 7 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
//! CLI for dkdc-links
2-
31
use anyhow::Result;
42
use clap::Parser;
53

@@ -11,58 +9,43 @@ use crate::open::open_links;
119
#[command(about = "Bookmarks in your terminal")]
1210
#[command(version)]
1311
pub struct Args {
14-
#[cfg(feature = "gui")]
15-
#[command(subcommand)]
16-
pub command: Option<Commands>,
17-
1812
/// Configure dkdc
1913
#[arg(short, long)]
2014
pub config: bool,
2115

16+
/// Open the graphical interface
17+
#[cfg(feature = "gui")]
18+
#[arg(long)]
19+
pub gui: bool,
20+
2221
/// Things to open
2322
pub links: Vec<String>,
2423
}
2524

26-
#[cfg(feature = "gui")]
27-
#[derive(clap::Subcommand, Debug)]
28-
pub enum Commands {
29-
/// Open the graphical interface
30-
Gui,
31-
}
32-
33-
/// Run the CLI with the given arguments
3425
pub fn run<I, T>(args: I) -> Result<()>
3526
where
3627
I: IntoIterator<Item = T>,
3728
T: Into<std::ffi::OsString> + Clone,
3829
{
3930
let args = Args::parse_from(args);
4031

41-
// Handle subcommands
4232
#[cfg(feature = "gui")]
43-
if let Some(command) = args.command {
44-
return match command {
45-
Commands::Gui => crate::gui::run().map_err(|e| anyhow::anyhow!("{e}")),
46-
};
33+
if args.gui {
34+
return crate::gui::run().map_err(|e| anyhow::anyhow!("{e}"));
4735
}
4836

49-
// Initialize config (creates default if doesn't exist)
5037
init_config()?;
5138

52-
// Handle --config flag
5339
if args.config {
5440
edit_config()?;
5541
return Ok(());
5642
}
5743

58-
// Load config
5944
let config = load_config()?;
6045

61-
// If no arguments, print config
6246
if args.links.is_empty() {
6347
print_config(&config);
6448
} else {
65-
// Open the links
6649
open_links(&args.links, &config)?;
6750
}
6851

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "dkdc-links"
3-
version = "2.0.0"
3+
version = "2.0.1"
44
description = "Bookmarks in your terminal"
55
authors = [{ name = "Cody", email = "cody@dkdc.dev" }]
66
requires-python = ">=3.11"

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)