Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/bash-completion/lmms
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ _lmms()
pars_render=(--float --bitrate --format --interpolation)
pars_render+=(--loop --mode --output --profile)
pars_render+=(--samplerate --oversampling)
actions=(dump render rendertracks upgrade)
actions=(dump compress render rendertracks upgrade)
actions_old=(-d --dump -r --render --rendertracks -u --upgrade)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The bash completion for compress works but it would also nice to have the old style --compress work.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right. None of the other actions are bash completing with old style longopts so scratch that for this PR.

shortargs+=(-a -b -c -f -h -i -l -m -o -p -s -v -x)

Expand Down
17 changes: 17 additions & 0 deletions src/core/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ void printHelp()
"Actions:\n"
" <no action> [options...] [<project>] Start LMMS in normal GUI mode\n"
" dump <in> Dump XML of compressed file <in>\n"
" compress <in> Compress file <in>\n"
" render <project> [options...] Render given project file\n"
" rendertracks <project> [options...] Render each track to a different file\n"
" upgrade <in> [out] Upgrade file <in> and save as <out>\n"
Expand Down Expand Up @@ -427,6 +428,22 @@ int main( int argc, char * * argv )

return EXIT_SUCCESS;
}
else if( arg == "compress" || arg == "--compress" )
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you update the code formatting to the Coding Conventions please?

Just some whitespace changes is all. 😄

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But it's adopting to the surrounding code so I think it's good like this.

{
++i;

if( i == argc )
{
return noInputFileError();
}

QFile f( QString::fromLocal8Bit( argv[i] ) );
f.open( QIODevice::ReadOnly );
QByteArray d = qCompress( f.readAll() ) ;
fwrite( d.constData(), sizeof(char), d.size(), stdout );

return EXIT_SUCCESS;
}
else if( arg == "render" || arg == "--render" || arg == "-r" ||
arg == "rendertracks" || arg == "--rendertracks" )
{
Expand Down