@@ -160,14 +160,20 @@ pub fn parse_file_size(input: &str) -> Result<u64, ParseFileSizeError> {
160160 Ok ( ( num * base. pow ( exponent) as f64 ) as u64 )
161161}
162162
163- fn print_version ( ) {
164- println ! (
165- "librespot {semver} {sha} (Built on {build_date}, Build ID: {build_id})" ,
163+ fn get_version_string ( ) -> String {
164+ #[ cfg( debug_assertions) ]
165+ const BUILD_PROFILE : & str = "debug" ;
166+ #[ cfg( not( debug_assertions) ) ]
167+ const BUILD_PROFILE : & str = "release" ;
168+
169+ format ! (
170+ "librespot {semver} {sha} (Built on {build_date}, Build ID: {build_id}, Profile: {build_profile})" ,
166171 semver = version:: SEMVER ,
167172 sha = version:: SHA_SHORT ,
168173 build_date = version:: BUILD_DATE ,
169- build_id = version:: BUILD_ID
170- ) ;
174+ build_id = version:: BUILD_ID ,
175+ build_profile = BUILD_PROFILE
176+ )
171177}
172178
173179struct Setup {
@@ -438,20 +444,14 @@ fn get_setup(args: &[String]) -> Setup {
438444 }
439445
440446 if matches. opt_present ( VERSION ) {
441- print_version ( ) ;
447+ println ! ( "{}" , get_version_string ( ) ) ;
442448 exit ( 0 ) ;
443449 }
444450
445451 let verbose = matches. opt_present ( VERBOSE ) ;
446452 setup_logging ( verbose) ;
447453
448- info ! (
449- "librespot {semver} {sha} (Built on {build_date}, Build ID: {build_id})" ,
450- semver = version:: SEMVER ,
451- sha = version:: SHA_SHORT ,
452- build_date = version:: BUILD_DATE ,
453- build_id = version:: BUILD_ID
454- ) ;
454+ info ! ( "{}" , get_version_string( ) ) ;
455455
456456 let backend_name = matches. opt_str ( BACKEND ) ;
457457 if backend_name == Some ( "?" . into ( ) ) {
0 commit comments