2 * Copyright 2016, François Revol, <revol@free.fr>. All rights reserved.
3 * Distributed under the terms of the MIT License.
7 * draggers - show/hide draggers from CLI
13 #include <Application.h>
19 fprintf(stderr
, "draggers [show|hide]\n");
20 fprintf(stderr
, "Shows/sets draggers state\n");
25 int main(int argc
, char **argv
)
28 BApplication
app("application/x-vnd.Haiku-draggers");
30 printf("%s\n", BDragger::AreDraggersDrawn()?"shown":"hidden");
33 for (i
= 1; i
< argc
; i
++) {
34 if (!strncmp(argv
[i
], "-h", 2)) {
35 return usage(EXIT_SUCCESS
);
37 if (!strcmp(argv
[i
], "1")
38 || !strncmp(argv
[i
], "en", 2)
39 || !strncmp(argv
[i
], "sh", 2)
40 || !strncmp(argv
[i
], "on", 2))
41 BDragger::ShowAllDraggers();
42 else if (!strcmp(argv
[i
], "0")
43 || !strncmp(argv
[i
], "di", 2)
44 || !strncmp(argv
[i
], "hi", 2)
45 || !strncmp(argv
[i
], "of", 2))
46 BDragger::HideAllDraggers();
48 return usage(EXIT_FAILURE
);