-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Implement compress action for commandline use #5341
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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" | ||
|
|
@@ -427,6 +428,22 @@ int main( int argc, char * * argv ) | |
|
|
||
| return EXIT_SUCCESS; | ||
| } | ||
| else if( arg == "compress" || arg == "--compress" ) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. 😄
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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" ) | ||
| { | ||
|
|
||
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.