File tree Expand file tree Collapse file tree 3 files changed +6
-2
lines changed
Expand file tree Collapse file tree 3 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ pub struct Flags {
1313 pub json : bool ,
1414 pub version_n_continue : bool ,
1515 pub shebang : bool ,
16+ pub sync : bool ,
1617}
1718
1819pub struct Args {
@@ -34,6 +35,7 @@ pub fn parse() -> Args {
3435 let mut collecting_args = false ;
3536 let mut version_n_continue = false ;
3637 let mut shebang = false ;
38+ let mut sync = false ;
3739
3840 for arg in std:: env:: args ( ) . skip ( 1 ) {
3941 if collecting_args {
@@ -61,6 +63,7 @@ pub fn parse() -> Args {
6163 "--version" => mode = Mode :: Version ,
6264 "--quiet" => quiet = true ,
6365 "--query" => mode = Mode :: Query ,
66+ "--sync" => sync = true ,
6467 "--shellcode" => {
6568 if !silent {
6669 eprintln ! ( "{}" , style( "⨯ migration required" ) . red( ) ) ;
@@ -120,6 +123,7 @@ pub fn parse() -> Args {
120123 json,
121124 quiet,
122125 version_n_continue,
126+ sync,
123127 } ,
124128 }
125129}
Original file line number Diff line number Diff line change @@ -272,7 +272,7 @@ async fn main() -> Result<(), Box<dyn Error>> {
272272 println ! ( "{}" , json) ;
273273 }
274274 Ok ( ( ) )
275- } else if !flags. version_n_continue {
275+ } else if !flags. version_n_continue && !flags . sync {
276276 clear_progress_bar ( ) ;
277277 eprintln ! ( "{}" , help:: usage( ) ) ;
278278 std:: process:: exit ( 2 ) ;
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ pub async fn setup(
2222 Some ( spinner)
2323 } ;
2424
25- let did_sync = if sync:: should ( & config) ? {
25+ let did_sync = if flags . sync || sync:: should ( & config) ? {
2626 if let Some ( spinner) = & spinner {
2727 spinner. set_message ( "syncing pkg-db…" ) ;
2828 }
You can’t perform that action at this time.
0 commit comments