Compare commits
6 commits
5b3ea6e976
...
74825f34a7
Author | SHA1 | Date | |
---|---|---|---|
Bruno BELANYI | 74825f34a7 | ||
Bruno BELANYI | f8687ee5bd | ||
Bruno BELANYI | bc54c3a6f6 | ||
Bruno BELANYI | 9d0f311598 | ||
Bruno BELANYI | 5002193c63 | ||
Bruno BELANYI | 66747de1bb |
|
@ -7,4 +7,8 @@ Language: Cpp
|
|||
# Force pointers to the type for C++.
|
||||
DerivePointerAlignment: false
|
||||
PointerAlignment: Left
|
||||
|
||||
# Break after every argument or not at all
|
||||
BinPackArguments: false
|
||||
BinPackParameters: false
|
||||
---
|
||||
|
|
|
@ -42,11 +42,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1631170176,
|
||||
"narHash": "sha256-RLN/kur2Kpxt0cJp0Fms8ixuGpT8IHX0OpeQ8u8f0X4=",
|
||||
"lastModified": 1633726775,
|
||||
"narHash": "sha256-imcgx7bHP0qzRNu31jknZAzze71pWnEbMbnBcZYxXMg=",
|
||||
"owner": "cachix",
|
||||
"repo": "pre-commit-hooks.nix",
|
||||
"rev": "3ed0e618cebc1ff291c27b749cf7568959cac028",
|
||||
"rev": "77b45d526e4dcc1f26ce449f5dc561f2e6eb5db6",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
14
flake.nix
14
flake.nix
|
@ -49,15 +49,12 @@
|
|||
|
||||
checks = {
|
||||
pre-commit = pre-commit-hooks.lib.${system}.run {
|
||||
src = self;
|
||||
src = ./.;
|
||||
|
||||
hooks = {
|
||||
clang-format = {
|
||||
enable = true;
|
||||
name = "clang-format";
|
||||
entry = "${pkgs.clang-tools}/bin/clang-format -style=file -i";
|
||||
types = [ "text" "c++" ];
|
||||
language = "system";
|
||||
types_or = [ "c++" ];
|
||||
};
|
||||
|
||||
nixpkgs-fmt = {
|
||||
|
@ -72,10 +69,9 @@
|
|||
defaultPackage = packages.dragger;
|
||||
|
||||
devShell = pkgs.mkShell {
|
||||
nativeBuildInputs = with pkgs; [ ]
|
||||
++ defaultPackage.nativeBuildInputs
|
||||
++ defaultPackage.buildInputs
|
||||
;
|
||||
inputsFrom = with packages; [
|
||||
dragger
|
||||
];
|
||||
|
||||
inherit (checks.pre-commit) shellHook;
|
||||
};
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#include <QApplication>
|
||||
#include <QCommandLineParser>
|
||||
#include <QDebug>
|
||||
#include <QDrag>
|
||||
#include <QFile>
|
||||
|
@ -9,10 +10,23 @@
|
|||
|
||||
int main(int argc, char* argv[]) {
|
||||
QApplication app(argc, argv);
|
||||
QApplication::setApplicationName("dragger");
|
||||
QApplication::setApplicationVersion("0.1.0");
|
||||
|
||||
QCommandLineParser parser;
|
||||
parser.setApplicationDescription("A CLI drag-and-drop tool");
|
||||
parser.addHelpOption();
|
||||
parser.addVersionOption();
|
||||
parser.addPositionalArgument(
|
||||
"files",
|
||||
QCoreApplication::translate("files", "files to drag-and-drop"),
|
||||
"[FILES...]");
|
||||
|
||||
parser.process(app);
|
||||
|
||||
QList<QUrl> urls;
|
||||
for (int i = 1; i < argc; ++i) {
|
||||
QFileInfo file(QFile(argv[i]));
|
||||
for (auto const& path : parser.positionalArguments()) {
|
||||
QFileInfo file{QFile{path}};
|
||||
if (file.exists()) {
|
||||
urls << QUrl("file:" + file.absoluteFilePath());
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue