From fa7df105b0d88f5808cbd11aea6b049e463ff1f1 Mon Sep 17 00:00:00 2001 From: thetasinner Date: Thu, 5 Mar 2026 17:04:53 +0000 Subject: [PATCH 1/4] chore: replace structopt with clap v4 Co-Authored-By: Claude Sonnet 4.6 --- Cargo.lock | 140 +++-------------------------------------- Cargo.toml | 2 +- src/bin/hc-scaffold.rs | 4 +- src/cli.rs | 19 +++--- src/cli/collection.rs | 14 ++--- src/cli/dna.rs | 6 +- src/cli/entry_type.rs | 20 +++--- src/cli/example.rs | 6 +- src/cli/link_type.rs | 20 +++--- src/cli/template.rs | 8 +-- src/cli/web_app.rs | 8 +-- src/cli/zome.rs | 10 +-- 12 files changed, 69 insertions(+), 188 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 64a54ecef..a570f4fb7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -60,15 +60,6 @@ dependencies = [ "libc", ] -[[package]] -name = "ansi_term" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" -dependencies = [ - "winapi", -] - [[package]] name = "anstream" version = "0.6.21" @@ -169,17 +160,6 @@ dependencies = [ "syn 2.0.106", ] -[[package]] -name = "atty" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" -dependencies = [ - "hermit-abi", - "libc", - "winapi", -] - [[package]] name = "autocfg" version = "1.5.0" @@ -365,21 +345,6 @@ dependencies = [ "windows-link 0.2.1", ] -[[package]] -name = "clap" -version = "2.34.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" -dependencies = [ - "ansi_term", - "atty", - "bitflags 1.3.2", - "strsim 0.8.0", - "textwrap", - "unicode-width 0.1.14", - "vec_map", -] - [[package]] name = "clap" version = "4.5.49" @@ -399,7 +364,7 @@ dependencies = [ "anstream", "anstyle", "clap_lex", - "strsim 0.11.1", + "strsim", ] [[package]] @@ -408,7 +373,7 @@ version = "4.5.49" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a0b5487afeab2deb2ff4e03a807ad1a03ac532ff5a2cee5d86884440c7f7671" dependencies = [ - "heck 0.5.0", + "heck", "proc-macro2", "quote", "syn 2.0.106", @@ -588,7 +553,7 @@ dependencies = [ "ident_case", "proc-macro2", "quote", - "strsim 0.11.1", + "strsim", "syn 2.0.106", ] @@ -602,7 +567,7 @@ dependencies = [ "ident_case", "proc-macro2", "quote", - "strsim 0.11.1", + "strsim", "syn 2.0.106", ] @@ -1292,30 +1257,12 @@ dependencies = [ "tokio", ] -[[package]] -name = "heck" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" -dependencies = [ - "unicode-segmentation", -] - [[package]] name = "heck" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" -[[package]] -name = "hermit-abi" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] - [[package]] name = "hex" version = "0.4.3" @@ -1413,6 +1360,7 @@ dependencies = [ "anyhow", "build-fs-tree", "cargo_metadata", + "clap", "colored", "convert_case 0.8.0", "dialoguer", @@ -1436,7 +1384,6 @@ dependencies = [ "serde", "serde_json", "serde_yaml", - "structopt", "syn 2.0.106", "thiserror 2.0.17", "tokio", @@ -1888,7 +1835,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e96d2465363ed2d81857759fc864cf6bb7997f79327aec028d65bd7989393685" dependencies = [ "ahash", - "clap 4.5.49", + "clap", "crossbeam-channel", "crossbeam-utils", "dashmap", @@ -1909,7 +1856,7 @@ version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1d57a3e447e24c22647738e4607f1df1e0ec6f72e16182c4cd199f647cdfb0e4" dependencies = [ - "heck 0.5.0", + "heck", "proc-macro2", "quote", "syn 2.0.106", @@ -1997,7 +1944,7 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbad37c00f223f07e078759ed6a857c47ad2c067f94b77880c36f46b593a98c7" dependencies = [ - "clap 4.5.49", + "clap", "lair_keystore_api", "pretty_assertions", "rpassword", @@ -2696,30 +2643,6 @@ dependencies = [ "toml_edit 0.23.4", ] -[[package]] -name = "proc-macro-error" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" -dependencies = [ - "proc-macro-error-attr", - "proc-macro2", - "quote", - "syn 1.0.109", - "version_check", -] - -[[package]] -name = "proc-macro-error-attr" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" -dependencies = [ - "proc-macro2", - "quote", - "version_check", -] - [[package]] name = "proc-macro2" version = "1.0.101" @@ -3502,42 +3425,12 @@ dependencies = [ "syn 2.0.106", ] -[[package]] -name = "strsim" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" - [[package]] name = "strsim" version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" -[[package]] -name = "structopt" -version = "0.3.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c6b5c64445ba8094a6ab0c3cd2ad323e07171012d9c98b0b15651daf1787a10" -dependencies = [ - "clap 2.34.0", - "lazy_static", - "structopt-derive", -] - -[[package]] -name = "structopt-derive" -version = "0.4.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcb5ae327f9cc13b68763b5749770cb9e048a99bd9dfdfa58d0cf05d5f64afe0" -dependencies = [ - "heck 0.3.3", - "proc-macro-error", - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "strum" version = "0.27.2" @@ -3550,7 +3443,7 @@ version = "0.27.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7695ce3845ea4b33927c055a39dc438a45b059f7c1b3d91d38d10355fb8cbca7" dependencies = [ - "heck 0.5.0", + "heck", "proc-macro2", "quote", "syn 2.0.106", @@ -3789,15 +3682,6 @@ dependencies = [ "serde", ] -[[package]] -name = "textwrap" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" -dependencies = [ - "unicode-width 0.1.14", -] - [[package]] name = "thiserror" version = "1.0.69" @@ -4279,12 +4163,6 @@ version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" -[[package]] -name = "vec_map" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" - [[package]] name = "version_check" version = "0.9.5" diff --git a/Cargo.toml b/Cargo.toml index f6e6c4060..c3ff758cb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,7 +31,7 @@ path-clean = "1.0.1" regex = "1.6.0" serde_yaml = "0.9.34" serde_json = "1" -structopt = "0.3.11" +clap = { version = "4", features = ["derive"] } thiserror = "2.0" tokio = { version = "1.11", features = ["full"] } toml = "0.8.14" diff --git a/src/bin/hc-scaffold.rs b/src/bin/hc-scaffold.rs index 84affdf35..9c54a7f05 100644 --- a/src/bin/hc-scaffold.rs +++ b/src/bin/hc-scaffold.rs @@ -1,10 +1,10 @@ +use clap::Parser; use colored::Colorize; use holochain_scaffolding_cli::cli::HcScaffold; -use structopt::StructOpt; #[tokio::main] async fn main() -> anyhow::Result<()> { - if let Err(e) = HcScaffold::from_args().run().await { + if let Err(e) = HcScaffold::parse().run().await { eprintln!("{}", e.to_string().red()); } Ok(()) diff --git a/src/cli.rs b/src/cli.rs index 4e847ea62..62d3ec4ba 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -6,9 +6,9 @@ use crate::scaffold::config::ScaffoldConfig; use crate::scaffold::example::ExampleType; use crate::scaffold::web_app::template_type::TemplateType; +use clap::Parser; use colored::Colorize; use std::{path::Path, str::FromStr}; -use structopt::StructOpt; mod collection; mod dna; @@ -19,24 +19,27 @@ mod template; mod web_app; mod zome; -#[derive(Debug, StructOpt)] +#[derive(Debug, Parser)] pub struct HcScaffold { - #[structopt(short, long, parse(try_from_str = TemplateType::from_str))] + #[arg(short, long, value_parser = TemplateType::from_str)] /// The template to use for the hc-scaffold commands. /// Can either be an option from the built-in templates: "vanilla", "svelte", "headless", /// or a path to a custom template. template: Option, - #[structopt(subcommand)] + #[command(subcommand)] command: HcScaffoldCommand, } /// A command-line interface for creating and modifying a Holochain application (hApp). -#[derive(Debug, StructOpt)] -#[structopt(setting = structopt::clap::AppSettings::InferSubcommands)] +#[derive(Debug, clap::Subcommand)] +#[command(infer_subcommands = true)] pub enum HcScaffoldCommand { WebApp(web_app::WebApp), - Template(template::Template), + Template { + #[command(subcommand)] + command: template::Template, + }, Dna(dna::Dna), Zome(zome::Zome), EntryType(entry_type::EntryType), @@ -53,7 +56,7 @@ impl HcScaffold { match self.command { HcScaffoldCommand::WebApp(web_app) => web_app.run(&template_type).await, - HcScaffoldCommand::Template(template) => template.run(&template_type), + HcScaffoldCommand::Template { command } => command.run(&template_type), HcScaffoldCommand::Dna(dna) => dna.run(&template_type), HcScaffoldCommand::Zome(zome) => zome.run(&template_type), HcScaffoldCommand::EntryType(entry_type) => entry_type.run(&template_type), diff --git a/src/cli/collection.rs b/src/cli/collection.rs index 4e368158d..ab91f0bcf 100644 --- a/src/cli/collection.rs +++ b/src/cli/collection.rs @@ -2,7 +2,7 @@ use std::str::FromStr; use colored::Colorize; use convert_case::Case; -use structopt::StructOpt; +use clap::Parser; use crate::{ file_tree::{build_file_tree, load_directory_into_memory}, @@ -17,14 +17,14 @@ use crate::{ utils::{check_case, input_with_case, run_cargo_fmt_if_available}, }; -#[derive(Debug, StructOpt)] +#[derive(Debug, Parser)] /// Scaffold a collection of entries in an existing zome pub struct Collection { - #[structopt(long)] + #[arg(long)] /// Name of the dna in which you want to scaffold the zome pub dna: Option, - #[structopt(long)] + #[arg(long)] /// Name of the integrity zome in which you want to scaffold the link type pub zome: Option, @@ -34,15 +34,15 @@ pub struct Collection { /// Collection name, just to differentiate it from other collections pub collection_name: Option, - #[structopt(parse(try_from_str = EntryTypeReference::from_str))] + #[arg(value_parser = EntryTypeReference::from_str)] /// Entry type that is going to be added to the collection pub entry_type: Option, - #[structopt(long)] + #[arg(long)] /// Skips UI generation for this collection. pub no_ui: bool, - #[structopt(long)] + #[arg(long)] /// Skips test generation for this collection. pub no_spec: bool, } diff --git a/src/cli/dna.rs b/src/cli/dna.rs index 1865cf2f5..705e72cda 100644 --- a/src/cli/dna.rs +++ b/src/cli/dna.rs @@ -1,6 +1,6 @@ +use clap::Parser; use colored::Colorize; use convert_case::Case; -use structopt::StructOpt; use crate::{ file_tree::{build_file_tree, load_directory_into_memory}, @@ -9,10 +9,10 @@ use crate::{ utils::{check_case, input_with_case}, }; -#[derive(Debug, StructOpt)] +#[derive(Debug, Parser)] /// Scaffold a DNA into an existing app pub struct Dna { - #[structopt(long)] + #[arg(long)] /// Name of the app in which you want to scaffold the DNA pub app: Option, diff --git a/src/cli/entry_type.rs b/src/cli/entry_type.rs index 3652b50a2..03139b3a0 100644 --- a/src/cli/entry_type.rs +++ b/src/cli/entry_type.rs @@ -2,7 +2,7 @@ use std::str::FromStr; use colored::Colorize; use convert_case::Case; -use structopt::StructOpt; +use clap::Parser; use crate::{ file_tree::{build_file_tree, load_directory_into_memory}, @@ -16,46 +16,46 @@ use crate::{ utils::{check_case, input_with_case, run_cargo_fmt_if_available}, }; -#[derive(Debug, StructOpt)] +#[derive(Debug, Parser)] /// Scaffold an entry type and CRUD functions into an existing zome pub struct EntryType { - #[structopt(long)] + #[arg(long)] /// Name of the dna in which you want to scaffold the entry type pub dna: Option, - #[structopt(long)] + #[arg(long)] /// Name of the integrity zome in which you want to scaffold the entry definition pub zome: Option, /// Name of the entry type being scaffolded pub name: Option, - #[structopt(long)] + #[arg(long)] /// Whether this entry type should be referenced with its "EntryHash" or its "ActionHash" /// If referred to by "EntryHash", the entries can't be updated or deleted pub reference_entry_hash: Option, - #[structopt(long, parse(try_from_str = Crud::from_str))] + #[arg(long, value_parser = Crud::from_str)] /// The Create, "Read", "Update", and "Delete" zome call functions that should be scaffolded for this entry type /// If "--reference-entry-hash" is "true", only "Create" and "Read" will be scaffolded pub crud: Option, - #[structopt(long)] + #[arg(long)] /// Whether to create a link from the original entry to each update action /// Only applies if update is selected in the "crud" argument pub link_from_original_to_each_update: Option, - #[structopt(long, value_delimiter = ",", parse(try_from_str = FieldDefinition::from_str))] + #[arg(long, value_delimiter = ',', value_parser = FieldDefinition::from_str)] /// The fields that the entry type struct should contain /// Syntax: ::: , (widget and linked_from are optional) /// Eg. "title:String:TextField" , "posts_hashes:Vec\::Post" pub fields: Option>, - #[structopt(long)] + #[arg(long)] /// Skips UI generation for this entry-type, overriding any specified widgets in the --fields option. pub no_ui: bool, - #[structopt(long)] + #[arg(long)] /// Skips test generation for this entry-type pub no_spec: bool, } diff --git a/src/cli/example.rs b/src/cli/example.rs index 7c7a40c5f..14fc64b1b 100644 --- a/src/cli/example.rs +++ b/src/cli/example.rs @@ -1,8 +1,8 @@ use std::{ffi::OsString, path::PathBuf}; use build_fs_tree::{Build, MergeableFileSystemTree}; +use clap::Parser; use colored::Colorize; -use structopt::StructOpt; use tokio::fs; use crate::{ @@ -30,13 +30,13 @@ use crate::{ utils::run_cargo_fmt_if_available, }; -#[derive(Debug, StructOpt)] +#[derive(Debug, Parser)] /// Scaffold an example hApp pub struct Example { /// Name of the example to scaffold. One of ['hello-world', 'forum']. pub example: Option, - #[structopt(long)] + #[arg(long)] /// Whether to setup the holonix development environment for the example hApp pub setup_nix: Option, } diff --git a/src/cli/link_type.rs b/src/cli/link_type.rs index 29d1487bb..a526f7a95 100644 --- a/src/cli/link_type.rs +++ b/src/cli/link_type.rs @@ -1,7 +1,7 @@ use std::str::FromStr; use colored::Colorize; -use structopt::StructOpt; +use clap::Parser; use crate::{ file_tree::{build_file_tree, load_directory_into_memory}, @@ -13,38 +13,38 @@ use crate::{ utils::run_cargo_fmt_if_available, }; -#[derive(Debug, StructOpt)] +#[derive(Debug, Parser)] /// Scaffold a link type and its appropriate zome functions into an existing zome pub struct LinkType { - #[structopt(long)] + #[arg(long)] /// Name of the dna in which you want to scaffold the zome pub dna: Option, - #[structopt(long)] + #[arg(long)] /// Name of the integrity zome in which you want to scaffold the link type pub zome: Option, - #[structopt(parse(try_from_str = Referenceable::from_str))] + #[arg(value_parser = Referenceable::from_str)] /// Entry type (or agent role) used as the base for the links pub from_referenceable: Option, - #[structopt(parse(try_from_str = Referenceable::from_str))] + #[arg(value_parser = Referenceable::from_str)] /// Entry type (or agent role) used as the target for the links pub to_referenceable: Option, - #[structopt(long)] + #[arg(long)] /// Whether to create the inverse link, from the "--to-referenceable" entry type to the "--from-referenceable" entry type pub bidirectional: Option, - #[structopt(long)] + #[arg(long)] /// Whether this link type can be deleted pub delete: Option, - #[structopt(long)] + #[arg(long)] /// Skips UI generation for this link-type. pub no_ui: bool, - #[structopt(long)] + #[arg(long)] /// Skips test generation for this link-type. pub no_spec: bool, } diff --git a/src/cli/template.rs b/src/cli/template.rs index 7d33e4893..85c4d8d40 100644 --- a/src/cli/template.rs +++ b/src/cli/template.rs @@ -1,19 +1,19 @@ use std::{ffi::OsString, path::PathBuf}; use build_fs_tree::{dir, file, Build, MergeableFileSystemTree}; -use structopt::StructOpt; +use clap::Subcommand; use crate::{scaffold::web_app::template_type::TemplateType, utils::input_with_case}; -#[derive(Debug, StructOpt)] -#[structopt(setting = structopt::clap::AppSettings::InferSubcommands)] +#[derive(Debug, Subcommand)] +#[command(infer_subcommands = true)] /// Manage custom templates pub enum Template { /// Create a new template from an existing scaffolding template New, /// Clone the template in use into a new custom template Clone { - #[structopt(long)] + #[arg(long)] /// The folder to initialize the template into, will end up at "" to_template: Option, }, diff --git a/src/cli/web_app.rs b/src/cli/web_app.rs index 4c438e1f2..3c417f2c6 100644 --- a/src/cli/web_app.rs +++ b/src/cli/web_app.rs @@ -3,9 +3,9 @@ use std::{ path::{Path, PathBuf}, }; +use clap::Parser; use colored::Colorize; use convert_case::{Case, Casing}; -use structopt::StructOpt; use tokio::fs; use crate::{ @@ -26,7 +26,7 @@ use crate::{ utils::{input_no_whitespace, input_with_case, input_yes_or_no, validate_input}, }; -#[derive(Debug, StructOpt)] +#[derive(Debug, Parser)] /// Scaffold a new, empty web app pub struct WebApp { /// Name of the app to scaffold @@ -35,11 +35,11 @@ pub struct WebApp { /// Description of the app to scaffold pub description: Option, - #[structopt(long)] + #[arg(long)] /// Whether to setup the holonix development environment for this web-app pub setup_nix: bool, - #[structopt(long, short = "F")] + #[arg(long, short = 'F')] /// Whether to skip setting up an initial DNA and it's zome(s) after the web app is scaffolded pub disable_fast_track: bool, } diff --git a/src/cli/zome.rs b/src/cli/zome.rs index 86ea5876d..34347ea29 100644 --- a/src/cli/zome.rs +++ b/src/cli/zome.rs @@ -1,9 +1,9 @@ use std::{ffi::OsString, path::PathBuf}; use build_fs_tree::{Build, MergeableFileSystemTree}; +use clap::Parser; use colored::Colorize; use convert_case::Case; -use structopt::StructOpt; use crate::{ file_tree::load_directory_into_memory, @@ -20,21 +20,21 @@ use crate::{ utils::{check_case, input_with_case, run_cargo_fmt_if_available}, }; -#[derive(Debug, StructOpt)] +#[derive(Debug, Parser)] /// Scaffold one or multiple zomes into an existing DNA pub struct Zome { - #[structopt(long)] + #[arg(long)] /// Name of the dna in which you want to scaffold the zome pub dna: Option, /// Name of the zome being scaffolded pub name: Option, - #[structopt(long, parse(from_os_str))] + #[arg(long)] /// Scaffold an integrity zome at the given path pub integrity: Option, - #[structopt(long, parse(from_os_str))] + #[arg(long)] /// Scaffold a coordinator zome at the given path pub coordinator: Option, } From 3470296577d3cfddef7f7ea8ebef7a8fbaba7e16 Mon Sep 17 00:00:00 2001 From: thetasinner Date: Thu, 5 Mar 2026 17:38:34 +0000 Subject: [PATCH 2/4] fixup! chore: replace structopt with clap v4 --- src/cli/collection.rs | 2 +- src/cli/entry_type.rs | 2 +- src/cli/link_type.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cli/collection.rs b/src/cli/collection.rs index ab91f0bcf..d47db7847 100644 --- a/src/cli/collection.rs +++ b/src/cli/collection.rs @@ -1,8 +1,8 @@ use std::str::FromStr; +use clap::Parser; use colored::Colorize; use convert_case::Case; -use clap::Parser; use crate::{ file_tree::{build_file_tree, load_directory_into_memory}, diff --git a/src/cli/entry_type.rs b/src/cli/entry_type.rs index 03139b3a0..d3e5c7b24 100644 --- a/src/cli/entry_type.rs +++ b/src/cli/entry_type.rs @@ -1,8 +1,8 @@ use std::str::FromStr; +use clap::Parser; use colored::Colorize; use convert_case::Case; -use clap::Parser; use crate::{ file_tree::{build_file_tree, load_directory_into_memory}, diff --git a/src/cli/link_type.rs b/src/cli/link_type.rs index a526f7a95..75347d098 100644 --- a/src/cli/link_type.rs +++ b/src/cli/link_type.rs @@ -1,7 +1,7 @@ use std::str::FromStr; -use colored::Colorize; use clap::Parser; +use colored::Colorize; use crate::{ file_tree::{build_file_tree, load_directory_into_memory}, From 0c5efa9aa0a5923822339d49884f150dbfe48d70 Mon Sep 17 00:00:00 2001 From: thetasinner Date: Thu, 5 Mar 2026 18:14:00 +0000 Subject: [PATCH 3/4] fixup! chore: replace structopt with clap v4 --- rust-toolchain.toml | 2 +- src/cli.rs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/rust-toolchain.toml b/rust-toolchain.toml index d6eb8fbf7..edc4de49c 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,4 +1,4 @@ [toolchain] -channel = "1.88.0" +channel = "1.89.0" components = ["rustfmt", "clippy"] profile = "minimal" diff --git a/src/cli.rs b/src/cli.rs index 62d3ec4ba..1fef3f28f 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -20,6 +20,7 @@ mod web_app; mod zome; #[derive(Debug, Parser)] +#[command(version)] pub struct HcScaffold { #[arg(short, long, value_parser = TemplateType::from_str)] /// The template to use for the hc-scaffold commands. From 12a8bb5c3889a6f13bc5ea7dc23d93c14c406c86 Mon Sep 17 00:00:00 2001 From: thetasinner Date: Thu, 5 Mar 2026 20:13:45 +0000 Subject: [PATCH 4/4] fixup! fixup! chore: replace structopt with clap v4 --- flake.nix | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/flake.nix b/flake.nix index 29cfe4c44..e234f8944 100644 --- a/flake.nix +++ b/flake.nix @@ -36,16 +36,20 @@ ''; }; systems = builtins.attrNames inputs.holonix.devShells; - perSystem = { inputs', self', config, system, pkgs, lib, ... }: { + perSystem = { inputs', self', config, system, pkgs, lib, ... }: + let + pkgsWithRust = import nixpkgs { + inherit system; + overlays = [ (import rust-overlay) ]; + }; + rustToolchain = pkgsWithRust.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml; + in + { formatter = pkgs.nixpkgs-fmt; packages.hc-scaffold = let - pkgs = import nixpkgs { - inherit system; - overlays = [ (import rust-overlay) ]; - }; - rustToolchain = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml; + pkgs = pkgsWithRust; craneLib = (crane.mkLib pkgs).overrideToolchain rustToolchain; crateInfo = craneLib.crateNameFromCargoToml { cargoToml = ./Cargo.toml; }; @@ -107,7 +111,7 @@ }; devShells.ci = pkgs.mkShell { - packages = [ inputs'.holonix.packages.rust self'.packages.hc-scaffold ]; + packages = [ rustToolchain self'.packages.hc-scaffold ]; }; }; };