[vlmc-devel] main.cpp: Implement --no-gui option

yikei lu luyikei.qmltu at gmail.com
Fri Jun 9 17:45:32 CEST 2017


Hmm, I have thought about that but all the options that we have is -vv
and --backendverbose. And when we don't use the gui, we are currently
making all the outputs regardless the log level so I just didn't
really consider that. But it's true that it's confusing if someone use
these options with --no-gui. I think I should do it in a better way :)
I'll probably fix soon with patches to make the cui mode able to
speficy the log level.

On Sat, Jun 10, 2017 at 12:42 AM, Hugo Beauzée-Luyssen <hugo at beauzee.fr> wrote:
>
>
> On Fri, Jun 9, 2017, at 02:07 PM, Yikai Lu wrote:
>> vlmc | branch: master | Yikai Lu <luyikei.qmltu at gmail.com> | Fri Jun  9
>> 20:56:56 2017 +0900| [4d542c629b7d30460cc50a43fa81c24f9dc30e16] |
>> committer: Yikai Lu
>>
>> main.cpp: Implement --no-gui option
>>
>> > https://code.videolan.org/videolan/vlmc/commit/4d542c629b7d30460cc50a43fa81c24f9dc30e16
>> ---
>>
>>  src/Main/main.cpp | 17 +++++++++++++----
>>  1 file changed, 13 insertions(+), 4 deletions(-)
>>
>> diff --git a/src/Main/main.cpp b/src/Main/main.cpp
>> index c6b2c73b..5fbf4c2f 100644
>> --- a/src/Main/main.cpp
>> +++ b/src/Main/main.cpp
>> @@ -199,7 +199,11 @@ VLMCCoremain( int argc, char **argv )
>>      /* Load a project file */
>>      if ( app.arguments().count() < 3 )
>>      {
>> -        vlmcCritical() << "Usage: ./vlmc project.vlmc output_file";
>> +        vlmcCritical() << "Usage: ./vlmc "
>> +#ifdef HAVE_GUI
>> +                << "--no-gui "
>> +#endif
>> +                << "project.vlmc output_file";
>>          return 1;
>>      }
>>
>> @@ -220,10 +224,15 @@ int
>>  VLMCmain( int argc, char **argv )
>>  {
>>  #ifdef HAVE_GUI
>> -    int res = VLMCGuimain( argc, argv );
>> +    if ( argc < 2 || strcmp( argv[1], "--no-gui" ) != 0 )
>
> Shouldn't you look for this argument in the all the command line
> arguments?
>
>> +    {
>> +        return VLMCGuimain( argc, argv );
>> +    }
>> +    // Remove --no-gui from argv
>> +    std::swap( argv[0], argv[1] );
>> +    return VLMCCoremain( argc - 1, argv + 1 );
>>  #else
>> -    int res = VLMCCoremain( argc, argv );
>> +    return VLMCCoremain( argc, argv );
>>  #endif
>> -    return res;
>>  }
>>
>>
>> _______________________________________________
>> Vlmc-devel mailing list
>> Vlmc-devel at videolan.org
>> https://mailman.videolan.org/listinfo/vlmc-devel
>
>
> --
>   Hugo Beauzée-Luyssen
>   hugo at beauzee.fr
> _______________________________________________
> Vlmc-devel mailing list
> Vlmc-devel at videolan.org
> https://mailman.videolan.org/listinfo/vlmc-devel


More information about the Vlmc-devel mailing list