@@ -19,7 +19,6 @@ use crossterm::{
19
19
} ,
20
20
} ;
21
21
use objdiff_core:: {
22
- bindings:: diff:: DiffResult ,
23
22
build:: {
24
23
BuildConfig , BuildStatus ,
25
24
watcher:: { Watcher , create_watcher} ,
@@ -28,7 +27,7 @@ use objdiff_core::{
28
27
ProjectConfig , ProjectObject , ProjectObjectMetadata , build_globset,
29
28
path:: { check_path_buf, platform_path, platform_path_serde_option} ,
30
29
} ,
31
- diff:: { self , DiffObjConfig , MappingConfig , ObjectDiff } ,
30
+ diff:: { DiffObjConfig , MappingConfig , ObjectDiff } ,
32
31
jobs:: {
33
32
Job , JobQueue , JobResult ,
34
33
objdiff:: { ObjDiffConfig , start_build} ,
@@ -40,10 +39,7 @@ use typed_path::{Utf8PlatformPath, Utf8PlatformPathBuf};
40
39
41
40
use crate :: {
42
41
cmd:: apply_config_args,
43
- util:: {
44
- output:: { OutputFormat , write_output} ,
45
- term:: crossterm_panic_handler,
46
- } ,
42
+ util:: term:: crossterm_panic_handler,
47
43
views:: { EventControlFlow , EventResult , UiView , function_diff:: FunctionDiffUi } ,
48
44
} ;
49
45
@@ -63,12 +59,6 @@ pub struct Args {
63
59
#[ argp( option, short = 'u' ) ]
64
60
/// Unit name within project
65
61
unit : Option < String > ,
66
- #[ argp( option, short = 'o' , from_str_fn( platform_path) ) ]
67
- /// Output file (one-shot mode) ("-" for stdout)
68
- output : Option < Utf8PlatformPathBuf > ,
69
- #[ argp( option) ]
70
- /// Output format (json, json-pretty, proto) (default: json)
71
- format : Option < String > ,
72
62
#[ argp( positional) ]
73
63
/// Function symbol to diff
74
64
symbol : Option < String > ,
@@ -171,11 +161,7 @@ pub fn run(args: Args) -> Result<()> {
171
161
_ => bail ! ( "Either target and base or project and unit must be specified" ) ,
172
162
} ;
173
163
174
- if let Some ( output) = & args. output {
175
- run_oneshot ( & args, output, target_path. as_deref ( ) , base_path. as_deref ( ) )
176
- } else {
177
- run_interactive ( args, target_path, base_path, project_config)
178
- }
164
+ run_interactive ( args, target_path, base_path, project_config)
179
165
}
180
166
181
167
fn build_config_from_args ( args : & Args ) -> Result < ( DiffObjConfig , MappingConfig ) > {
@@ -194,28 +180,6 @@ fn build_config_from_args(args: &Args) -> Result<(DiffObjConfig, MappingConfig)>
194
180
Ok ( ( diff_config, mapping_config) )
195
181
}
196
182
197
- fn run_oneshot (
198
- args : & Args ,
199
- output : & Utf8PlatformPath ,
200
- target_path : Option < & Utf8PlatformPath > ,
201
- base_path : Option < & Utf8PlatformPath > ,
202
- ) -> Result < ( ) > {
203
- let output_format = OutputFormat :: from_option ( args. format . as_deref ( ) ) ?;
204
- let ( diff_config, mapping_config) = build_config_from_args ( args) ?;
205
- let target = target_path
206
- . map ( |p| obj:: read:: read ( p. as_ref ( ) , & diff_config) . with_context ( || format ! ( "Loading {p}" ) ) )
207
- . transpose ( ) ?;
208
- let base = base_path
209
- . map ( |p| obj:: read:: read ( p. as_ref ( ) , & diff_config) . with_context ( || format ! ( "Loading {p}" ) ) )
210
- . transpose ( ) ?;
211
- let result =
212
- diff:: diff_objs ( target. as_ref ( ) , base. as_ref ( ) , None , & diff_config, & mapping_config) ?;
213
- let left = target. as_ref ( ) . and_then ( |o| result. left . as_ref ( ) . map ( |d| ( o, d) ) ) ;
214
- let right = base. as_ref ( ) . and_then ( |o| result. right . as_ref ( ) . map ( |d| ( o, d) ) ) ;
215
- write_output ( & DiffResult :: new ( left, right) , Some ( output) , output_format) ?;
216
- Ok ( ( ) )
217
- }
218
-
219
183
pub struct AppState {
220
184
pub jobs : JobQueue ,
221
185
pub waker : Arc < TermWaker > ,
0 commit comments