@@ -14,10 +14,15 @@ pub enum BindingsLanguage {
1414
1515#[ derive( Args , Debug ) ]
1616pub struct GenerateBindingsCommand {
17+ /// The programming language to generate bindings in
1718 #[ clap( short = 'L' , long) ]
1819 pub language : BindingsLanguage ,
20+
21+ /// Output directory
1922 #[ clap( short = 'o' , long) ]
2023 pub output : PathBuf ,
24+
25+ /// Id of the component, which dependencies to generate the bindings for
2126 #[ clap( short = 'c' , long) ]
2227 pub component_id : String ,
2328}
@@ -40,8 +45,18 @@ impl GenerateBindingsCommand {
4045
4146 match & self . language {
4247 BindingsLanguage :: Rust => {
48+ // TODO: If wit-bindgen is not in Cargo.toml, make sure to add it.
4349 let opts = wit_bindgen_rust:: Opts {
4450 generate_all : true ,
51+ // TODO: Make the extra attributes a clap option
52+ additional_derive_attributes : vec ! [
53+ "serde::Serialize" . to_string( ) ,
54+ "serde::Deserialize" . to_string( ) ,
55+ "Hash" . to_string( ) ,
56+ "Clone" . to_string( ) ,
57+ "PartialEq" . to_string( ) ,
58+ "Eq" . to_string( ) ,
59+ ] ,
4560 // Uncomment this once spin-sdk is updated and remove dependency on wit_bindgen in Cargo.toml
4661 //runtime_path: Some("::spin_sdk::wit_bindgen".to_string()),
4762 ..Default :: default ( )
0 commit comments