File tree Expand file tree Collapse file tree 5 files changed +47
-12
lines changed
packagefiles/ignore-result-0.2.0 Expand file tree Collapse file tree 5 files changed +47
-12
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ subprojects/bitflags-[0-9]*
66subprojects /clap- [0-9 ]*
77subprojects /clap_builder- [0-9 ]*
88subprojects /clap_lex- [0-9 ]*
9+ subprojects /ignore-result- [0-9 ]*
910subprojects /io-lifetimes- [0-9 ]*
1011subprojects /itoa- [0-9 ]*
1112subprojects /libc- [0-9 ]*
Original file line number Diff line number Diff line change @@ -17,14 +17,12 @@ if rustc.version().version_compare('<1.69')
1717endif
1818
1919clap_rs_dep = dependency (' clap-rs' , version : ' >=4.1.13' )
20+ ignore_result_rs_dep = dependency (' ignore-result-rs' , version : ' >=0.2.0' )
2021serde_rs_dep = dependency (' serde-rs' , version : ' >=1.0.160' )
2122serde_json_rs_dep = dependency (' serde_json-rs' , version : ' >=1.0.96' )
2223
2324fqDataDir = get_option (' prefix' ) / get_option (' datadir' ) / ' refivar'
2425
25- lib_refivar_rs_sources = [
26- ]
27-
2826lib_refivar_guids_json = (
2927 meson .project_source_root() / ' src' / ' lib' / ' efivar' / ' guids.json'
3028)
@@ -88,6 +86,7 @@ executable(
8886 link_with : lib_refivar,
8987 dependencies : [
9088 clap_rs_dep,
89+ ignore_result_rs_dep,
9190 serde_rs_dep,
9291 serde_json_rs_dep
9392 ],
Original file line number Diff line number Diff line change 11use clap;
22use efivar:: efi_guids;
3+ use ignore_result:: Ignore ;
4+ use std:: io;
35use std:: process:: ExitCode ;
46
57fn create_parser ( ) -> clap:: Command {
@@ -108,28 +110,24 @@ fn create_parser() -> clap::Command {
108110}
109111
110112fn main ( ) -> ExitCode {
111- let matches = create_parser ( ) . get_matches ( ) ;
113+ let mut parser = create_parser ( ) ;
114+ let matches = parser. get_matches_mut ( ) ;
112115 if matches. get_flag ( "list-guids" ) {
113116 let mut guid_list: efi_guids:: EfiGuidList = Default :: default ( ) ;
114117 match guid_list. load ( matches. get_one ( "guids-list-path" ) . unwrap ( ) ) {
115118 Ok ( ( ) ) => {
116119 for g in guid_list. guids ( efi_guids:: GuidListSortField :: Guid ) {
117120 println ! ( "{}" , g) ;
118121 }
119- println ! ( "" ) ;
120- for g in guid_list. guids ( efi_guids:: GuidListSortField :: Id ) {
121- println ! ( "{}" , g) ;
122- }
123- println ! ( "" ) ;
124- for g in guid_list. guids ( efi_guids:: GuidListSortField :: None ) {
125- println ! ( "{}" , g) ;
126- }
127122 }
128123 Err ( e) => {
129124 eprintln ! ( "Failed to read GUIDs list file: {}" , e) ;
130125 return std:: process:: ExitCode :: from ( 1 ) ;
131126 }
132127 }
128+ } else {
129+ parser. write_help ( & mut io:: stderr ( ) ) . ignore ( ) ;
130+ return std:: process:: ExitCode :: from ( 1 ) ;
133131 }
134132 return std:: process:: ExitCode :: from ( 0 ) ;
135133}
Original file line number Diff line number Diff line change 1+ [wrap-file]
2+ directory = ignore-result-0.2.0
3+
4+ source_url = https://crates.io/api/v1/crates/ignore-result/0.2.0/download
5+ source_filename = ignore-result.tar.gz
6+ source_hash = 665ff4dce8edd10d490641ccb78949832f1ddbff02c584fb1f85ab888fe0e50c
7+ patch_directory = ignore-result-0.2.0
8+
9+ [provide]
10+ ignore-result-rs = ignore_result_rs_dep
Original file line number Diff line number Diff line change 1+ project (
2+ ' ignore-result-rs' ,
3+ ' rust' ,
4+ version : ' 0.2.0' ,
5+ meson_version : ' >=1.1.0' ,
6+ default_options : [
7+ ' buildtype=debugoptimized' ,
8+ ' rust_std=2021'
9+ ]
10+ )
11+
12+ rustc = meson .get_compiler(' rust' )
13+ if rustc.version().version_compare(' <1.69' )
14+ error (' rustc 1.69 required. Found ' + rustc.version())
15+ endif
16+
17+ lib_ignore_result = static_library (' ignore_result' , ' src/lib.rs' ,
18+ rust_args : [],
19+ rust_crate_type : ' rlib' ,
20+ dependencies : [],
21+ pic : true ,
22+ )
23+
24+ ignore_result_rs_dep = declare_dependency (
25+ link_with : lib_ignore_result,
26+ dependencies : []
27+ )
You can’t perform that action at this time.
0 commit comments